Learning Boost { It seems that this has not been answered in the FAQ. -mod } I've just joined the group. Could someone please recommend a good book for learning Boost? Thanks. /Why Tea -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this!... 30 Jun 2010 03:14
conversion from `std::_List_iterator<int>' to non-scalar type `std::_List_iterator<int*>' requested I don't understand. Can some one explain the issue here. Thanks ------------ template <typename T> static typename list<int>::iterator find_an_element(list<T>& a, const T& b) { typename list<T>::iterator itt = a.begin() ; while (itt != a.end()) { if (*itt == b) { break ; } itt... 30 Jun 2010 08:39
initializer_list members not being constexpr anymore Hi, as seen in the last C++0x standard draft, initializer_list's begin/ end/size aren't constexpr anymore. What is the rationale for that? The returned values are known at compile time, I don't see why they cannot be constexpr. Regards, Rodolfo Lima -- [ See http://www.gotw.ca/resources/clcm.htm for ... 7 Jul 2010 23:22
best way to disambiguate an overloaded function. I have some code like: std::for_each(pairVecVec.begin(), pairVecVec.end(), printNVPairs); Where printNVPairs has a couple of overloads. So printNVPairs needs to be disambiguated. There seem to be a few ways to do this. 1. Write a wrapper function with a different name 2. Assign printNVPairs to... 1 Jul 2010 11:04
When I convert "0.0003" and "3.e-4" in VC++ they are the same { Please use a proper style of quoting. With the style used here, it is difficult for the readers to find out which article your reply is made to and which context it is referring to. The canonical style goes like this: <example> previous author wrote: the previous content what you add to it ... 30 Jun 2010 03:14
Solid C++ by example At the NDC2010 conference, I gave a presentation where I demonstrated Solid C++ code by example: http://www.slideshare.net/olvemaudal/solid-c-by-example It would be great to have your opinion about the examples I present. Is this solid code, or can it be improved even further? Thanks, - olve -- ... 6 Jul 2010 07:51
Lifetime of a temporary bound to a reference I'm not sure what the standard says about a case like this (mainly per 12.2/5): class B {}; class D1: public B {}; class D2: public B {}; void foo( bool r ) { B const& a = ( r ? D1() : D2() ); // Does the temporary live here? } itaj -- [ See http://www.gotw.ca/resources/clcm.htm for info ab... 28 Jun 2010 20:33
You can't trust what the debugger tells you the value is You said "If you stop in the debugger and examine the value of the double, you will find it to be -937566.23646998685 ... on output VC++ is rounding whereas G++ is truncating." The debugger is not printing all the digits. Try printing the double in hex with the %a format specifier ("%.13a" gets all the digits in V... 27 Jun 2010 10:37
deleted functions and conversions Below is a toy class that I had posted some while ago in a response to comp.lang.c++ and which attempts to model a `reseatable reference'. In itself it is unimportant, offered merely to aid discussion, but I did think that I could simplify it under C++0x using a deleted copy assignment operator, only to find out ... 28 Jun 2010 16:08
Use of double type in float subtraction vs precision Hi, can double type rapresent exactly every result when subtracting two floats? Example: float a; float b; double result; result = (double)a - (double)b; Does result suffer of some rounding issue in this case or it would always rapresent the very correct result? Thank you all for help. -- ... 28 Jun 2010 17:15 |