First  |  Prev |  Next  |  Last
Pages: 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
Can name be reused in different block?
#include <iostream> #include <typeinfo> using namespace std; typedef int T; T a, (*(*b)(T))(T); int main (int argc, char** argv) { typedef double T; T(a), (*(*b(T)))(T); cout << typeid(::a).name() << endl; cout << typeid(a).name() << endl; cout << typeid(::b).name() << endl; cout << typeid(b).... 21 Dec 2009 20:14
copy constructor and assignment
Hello, I have the following class definition: class test2{ public: int y; test2(int ui) : y(ui){} test2(const test2& t) : y(5){} test2& operator= (const test2& t){ y = 6; return *this; } }; In an expression like test2 t2(test2(20)); or test2(t2) = test2(20); neither the copy-constructor ... 15 Dec 2009 20:02
Non-static singleton setup to control life time
I want to setup a singleton, without 'static' initialization. My motive is to control the life time of the Singleton, bounded by its scope, something I cannot do with the statics. Not this way. This uses static: Single* Get() { Static Single s; // do not want static Return &s; } Instead, I am doin... 17 Dec 2009 09:15
'const' and compiler optimization
In the past, i do remember that 'const' was a matter of documentation that the compiler forces to follow. But now i think things have being changed, e.g. in std::set the key is 'const' for correctness, nevertheless there is a const_cast that the programmer can use... So the question is: does the compiler take a... 13 Dec 2009 20:53
Use c++ to draw a figure of a graph(data structure)
{ Algorithm questions still belong to a language-independent forum, but questions about using the Boost Graph Library can fit here. -mod } Hi,all. I need to draw a figure of a graph(data structure). C++ is used in my code. The moderators told me to go to a language-independent forum. Considering *boost gr... 14 Dec 2009 13:12
Inexplicable compiler error (VS '08)
This has been driving me completely bonkers for the past two days now, and I'm at my wit's end. Let's say I have a class Foo, which is defined in Foo.h and implemented in Foo.cpp. In another class, I want to instantiate a Foo object. Pretty simple. #include "Foo.h" int OtherClass::SomeFunction(void) { Foo... 14 Dec 2009 13:12
calling this->~T() inside T::operator=3D
On 10 d=E9c, 13:40, Taras Shevchuk <sh...(a)gala.net> wrote: 2. in case if T is base class then "this->~T();" will partially delete object. Not if the destructor is virtual. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do t... 13 Dec 2009 10:59
Template typedef parameter
I am trying to use this code as a parameter like this: template<typename T> void takesCollection(typename Collection<T>::Type col) { } using this class here: template<typename C, typename Enable = void> class Collection { }; template<typename C> class Colle... 18 Dec 2009 20:32
boost graph library, default_dfs_visitor, dfs
Hi Please see the code below. class my_visitor: public default_dfs_visitor { public: my_visitor(){} void finish_vertex(Vertex u, const Graph & g); vector<Vertex> getFinishingOrder(void){return finishingOrder;} //private: vector<Vertex> finishingOrder;//stores the vertices in the finishing order }; ... 11 Dec 2009 18:02
unique id (uid, uuid, guid etc) class needed
Hello, I need a uuid class. After a bit of googling I see that at some point there was some work in boost for this but it looks like it will be a while before it is generally available. It is not in 1.41.1. Does anyone know if there is one available elsewhere? It must be portable of course. The project I am curr... 25 Dec 2009 19:03
First  |  Prev |  Next  |  Last
Pages: 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59