What does Ctor::Ctor prototype mean? Hi, For a class ABC. Can we declare the Ctor as ABC::ABC()? In particular for a class template, what is the semantics? Please look at the code below. It doesn't compile on VC2008. class Base { public: Base::Base() {} virtual ~Base() {} } ; template <class T> class ABC : public Base { public: ABC:... 29 Jul 2010 20:42
why are missing return statements from non-void functions not a compilation error Organization: http://groups.google.com References: <af3b997e-24fd-4ef0-9e00-5fa6926d60d9(a)c16g2000vbp.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 X-Clcppm-Sequence: 34100 X-Original-Date: Thu, 29 Jul 2010 01:02:09 -0700 (PDT) X-Submission-Address: c++-submit(a)netlab.cs.rpi.edu... 8 Aug 2010 17:48
Const char* query.. Hi There, This is only for my understanding... I know most of the code in here is wrong. But I was trying out something and am trying to make some sense out of it.. the code is as follows: int main( void ) { const char* ptrCh = new char[50]; ptrCh = "ABCDE"; cout... 30 Jul 2010 15:11
on a quest for C++ hamcrest matchers library Hello, Can some kind person please point me in the direction of the hamcrest matcher library ported to C++? The main hamcrest web pages say that there is a port but do not provide any links. My googling has been unsuccessful. The closest I have found is some hamcrest-like matchers in GoogleMocks. But they seem t... 28 Jul 2010 19:33
why are missing return statements from non-void functions not a compilation error > One of them, C4715, is "not all control paths return a value". Sure enough, the function in question has a return type of int, and there are various embedded returns but no final return at the end, a control path that it can get to. So my question is, "why is this not a fatal compilation error?". I... 27 Jul 2010 17:15
Boost.Any doesn't respect type conversion For example: int f(boost::any pi) { if(int i = boost::any_cast<const int*>(pi)) { return i; } } int main() { int a = 1; f(boost::any(&a));//throw an bad_any_cast exception } Boost::any can not handle derived-to-base cast too, so It seems boost::any is not appropriate to be ... 27 Jul 2010 17:15
why are missing return statements from non-void functions not a compilation error In the process of cleaning up some legacy C++ code I have been eliminating various compiler warnings I am getting from Visual Studio. One of them, C4715, is "not all control paths return a value". Sure enough, the function in question has a return type of int, and there are various embedded returns but no final ret... 28 Jul 2010 19:33
Why cannot I get initializer_list like objects without using them? Please, why wouldn't the code (1) below work with c++0x? template< unsigned dimen, class vtype = const unsigned& > struct n_vect { vtype head; n_vect< dimen - 1, vtype > rest; }; template< class vtype > struct n_vect< 1u, vtype > { vtype head; }; void myFun( n_vect< 10 >& par ) { } int main() { n_vect< 10 > test = {1, 2, 3, 4, 5, 6, 7, 8, 9,... 27 Jul 2010 10:35
outer class `this` in local classes without inheritance? Hello all, I am new to this groups. I would like to post a C++ programming question. Is there a way to access the outer class `this` from a local class but without using inheritance? Let me explain with an example: class x { // outer class public: void g() {} void f() { ... 3 Aug 2010 18:02
Templates in application level code (was: Re: Any hopes for export ?) James Kanze wrote: On Jul 23, 1:02 pm, Walter Bright <newshou...(a)digitalmars.com> wrote: Timothy Madden wrote: The main reasons I hear now against export are that it is not actively demanded (users always have the old inclusion model), that it is costly to implement, and that it has not been imple... 26 Jul 2010 13:49 |