C++ Passion = Madness Given that many other programming languages are easier to learn/use, is my passion for C++ a form of madness? No idea why, but I enjoy challenge of scope resolution, templates, memory management, and all the other things that cause newcomers to C++ such confusion. JB -- [ See http://www.gotw.ca/resou... 18 May 2010 18:06
So, it's not just ANY compile error that can be used with SFINAE. To do type introspection most of the time we use compile errors about non-existing types combined with SFINAE. But I thought that any compile error during an instantiation of a class template would disable that overload from the list of viable instantiations suppressing the actual error. Turns out not to be the c... 28 May 2010 03:55
Does covariant return types hold for non-virtual? Hi, In �10.3/5 they explain covariant return types. Do they hold also for non-virtual functions? I.e. is this legal on all compilers according to the standard? struct A_helper { A& fnc(); }; struct B_helper { B& fnc(); }; struct A : A_helper { }; struct B : A, B_helper { }; The i... 20 May 2010 23:45
Constrained name value pairs or pre-filled names types? Looking for something similar to a map type, but which allows me to define a new type (possibly via templates?) at compile time, with the expected NAMES filled in. Values will come in at runtime. so just to illustrate : supposing i have 2 valid names with expected values :- name,age so foo.name = "myn... 10 May 2010 15:25
make_array - or auto deducing the number of elements to std::array Multiple people (including me) in this newsgroup have opined that it would be convenient to have a make_array facility that automatically deduced the type and number of elements to std::array. In essence, it should not be unreasonable to expect the following to work: auto a = make_array({1,2,3}); // array<int,... 9 May 2010 18:41
Can you solve this function chaining quiz? Hi, I have a problem. I want to throw ExceptionA derived from Exception, i.e. struct ExceptionA : Exception { }; ExceptionA, ExceptionB, ExceptionC, etc. shall be able to attach text to the exception directly at construction via function chaining, i.e. throw ExceptionA().addText( "Hello" ).addText( "World... 22 May 2010 14:55
C++ Compiler Hello All, I am thinking of picking up C++. Just wondering which is the best compiler that I should go for? Any help. My main application is in computational finance. Thank you. { Bjarne Stroustrup maintains an incomplete list of C++ compilers at <http://www.research.att.com/~bs/compilers.html>. -mod/sk ... 24 May 2010 11:12
c++0x perfect forwarding (again) Hi, Given: need to implement a perfect-forwarding function f. First attempt: template <typename Func, typename ... Prms> inline typename std::result_of<Func(Prms...)>::type f(Func && f, Prms && ... prms) { return f(std::forward<Prms>(prms)...); } The implementation seems reasonable - it'll be abl... 8 May 2010 13:23
Template specialisation question Hi all, I've been wondering for a couple of days now - why won't the following code compile (fails on both gcc and comeau online): struct X { int t; template <typename T> struct Y { T t; }; }; template <typename T1, typename T2> struct A { }; template<typename... 8 May 2010 13:23
ANNOUNCE: V1.4 (FCD edition) of just::thread C++0x thread library released I am pleased to announce that version 1.4 (the FCD edition) of just::thread, our C++0x Thread Library has just been released. With the release of the "FCD edition", just::thread provides the first complete implementation of the multithreading facilities from the Final Committee Draft (FCD) of the C++0x standard. ... 6 May 2010 20:56 |