|
"strict weak ordering" requirement of compare argument for std::set Hi, if I'm not mistaken, the compare parameter of the std::set template has to fulfill the "strict weak ordering" requirement. In contrast to a "total ordering", two objects might just not be comparable by a strict weak ordering, i.e. neither x < y nor y < x although x != y. So using a "strict weak ordering", ... 17 Jan 2008 06:16
Operator!= injection (from std::rel_ops) bourez(a)gmail.com wrote: Hi, Hello When including the .h file with a class definition having operator== defined, I would like also to automatically provide this class with operator!= without giving the implementation, but by reusing an existing one (the one defined in std::rel_ops). Actually, I wou... 16 Jan 2008 14:12
Optimizing away copy constructors Hi Alan McKenney wrote: After reading yet another discussion of the Return Value Optimization, and how it has received Explicit Dispensation from the Holy Standard, I can't help wondering: why not allow copy constructors to be optimized away _whenever_ a copy isn't really necessary? As... 16 Jan 2008 08:03
template gourav.panda89(a)yahoo.co.in wrote: what is the difference betweeen class template and template class? Both are normally used in the same sense, even in the C++ Standard. Personally, I find "template class", just like "template function", misleading. A template by itself can never be a class or a function, onl... 15 Jan 2008 16:53
template function ambiguity kiran wrote: I have a very simple template swap function as follows: # include <iostream> using namespace std ; template <class T> void swap(T& m, T& n) { T temp ; temp = m; m = n ; n = temp ; } In the main function, I call this function with int para... 14 Jan 2008 20:44
RVO I was reading Post subject "class returning member function", Dated -12/ 27-28 /07 and found it not to be of value. Return Value Optimization RVO seems to do no better than a bitwise assignment. Except the bitwise is more efficient if that is what RVO is to accomplish. What is the value or need of RVO? Jeff ... 19 Jan 2008 05:06
std::deque typically faster then std::list for push_back(), front(), pop_front()? Lance Diduck wrote: On Jan 10, 10:08 am, "Victor V. Terber" <VTer...(a)gmail.com> wrote: In existing sources I found a std::list using only methods push_back(), front() and pop_front(). I'm considering to replace the list by std::deque. The usual rule of thumb to use the simplest container that doe... 11 Jan 2008 23:23
About Int2Type cppcraze wrote: Hi, Since loki help forum is not responded timely, I would like to ask a simple question here about Int2Type defined by Mr Alexandrescu. Following is definition of Int2Type: template<int v> struct Int2Type { enum { value = v }; }; My question is: is the e... 11 Jan 2008 22:49
std::deque typically faster then std::list for push_back(), front(), pop_front()? Matthias Buelow wrote: Victor V. Terber wrote: Does such a replacement of list by deque seem reasonable? Would you typically expect real-world performance changes? If properly implemented, ordinary lists and doubly-linked lists have the same performance characteristics for common operations. Th... 11 Jan 2008 14:49
Objects returned by value don't use copy constructors! Hi, I thought that a copy constructor has to be involved, when a function returns an object by value. It doesn't have to be so, as shown by running the code at the end of my email (I used GCC 3.4.6 on Linux). Run the code, and you'll see that the copy constructor is not called, and that the destructor is called... 13 Jan 2008 07:06 |