First  |  Prev |  Next  |  Last
Pages: 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
Polymorphism question
Hi, I have the following piece of code: #include <iostream> #include <vector> #include <functional> using namespace std; class Shape { public: virtual void draw(){cout << "Drawing a shhape\n"; }; }; class Triangle : public Shape { public: void draw() { static int counte... 31 Mar 2008 19:20
More proposals for c++ modules.
Hello. I want to make some proposals for the modules paper. I think the most natural approach to c++ is to have packages and modules. The idea is not new, and I think is the best mapping for c++. The idea I didn't like about the vocabulary in the paper is that of modules and "module partitions". I think they don... 31 Mar 2008 19:20
classes with pointer data members.
On Mar 28, 6:13 pm, mpho <tjab...(a)gmail.com> wrote: To my earlier question in this thread, a (simpler :-) solution that worked without throwing all sorts of exceptions is: T& T::operator=(const T& other){ if (this == &other) return *this; else { type *p = new type[s] //s -> ... 9 Apr 2008 19:35
Small grammar addition for c++0x. Why not?
On Mar 28, 9:43 am, german diago <germandi...(a)gmail.com> wrote: Hello. I'd like to propose a small grammar addition for inclusion in c+ +0x. It's quite simple, and I wonder why this isn't allowed in the current language. Example. using namespace std; using namespace boost; using namespace mylib; ... 1 Apr 2008 16:14
Reference Member variables
smawsk wrote: Hi, I am writing a sample program to use a reference member variable. But I was surprised to know that the below piece of code is not working as I expected. Can some one let me know what's wrong with this code? class X { public: X(int x) : ref(x) { } voi... 31 Mar 2008 19:20
A question about allocating many std::string and another one about profiling stl memory allocation
luca.regini(a)gmail.com ha scritto: Hi, i have an application that allocates many small classes that contains a small number of std::string members. This results in a number of dynamically allocated std::string that is in the order of one milion. I would like to understand what is the (memory) penalty that... 31 Mar 2008 17:57
Return versus Side-Effect
Carl Barron ha scritto: In article <47ebc3fb$0$14342$e4fe514c(a)news.xs4all.nl>, Niels Dekker - no return address <noreply(a)this.is.invalid> wrote: const std::string & constFoo = doManipulation("bar"); And if the user needs to have non-const access to the returned string, she can still avoid c... 3 Apr 2008 16:20
delete construct
I have a class as below: class Dpost { public: void* operator new[](size_t) { cout << "Allocating a Dpost" << endl; throw 1; } void operator delete[](void* p) { cout << "Deallocating a Dpost" << endl; ::operator delete[](p); } }; in the main function, I want to clean up t... 31 Mar 2008 19:20
BoostCon 2008 Call for Sessions
The second annual Boost conference will take place in Aspen, Colorado, May 5-9. BoostCon is the main face-to-face event for all things Boost, from generic-programming techniques to Boost community, from using Boost libraries to writing Boost libraries, from deployment considerations to promoting the use of Boost ... 1 Feb 2008 17:01
getting a name of a polymorphic type
Hi, I know that typeid(*this).name() is not portable. Therefore I resorted to implementing my own virtual function that returns the name of the class. Nonetheless, is there any portable way so that I don't need to keep implementing this function for new classes? Thanks & best, Irek -- Ireneusz (Irek)... 1 Feb 2008 00:44
First  |  Prev |  Next  |  Last
Pages: 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70