First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
compilation error when Base Constructor calling pure virtual method
Why does this compile when I define the body of the constructor in the header versus when I define the body of the constructor in the cpp file? // Works class A { public: A() {f();} virtual ~A() {} virtual void f() = 0; int a1_; }; // Generates Linker Error class A2 { public: A2(); virtua... 6 Jul 2010 22:13
Is the Mixin pattern accepted in all camps?
Hi, As I understand, Policies have been widely accepted, but is it the same with Mixins? Or does people still believe Mixin is a bad way to avoid Liskov's IS-A principle? My latest Mixin looks like this. template<class T> class CopyMixin { public: typedef std::shared_ptr<T> SPtr; SPtr copy() con... 11 Jul 2010 14:50
constexpr array function pointers as fast as switch
Is there any reason, other than compiler optimization limitations, why, in the following code, dispatch_funvec should be any slower than dispatch_switch. Are current implementations of dispatch_funvec slower just because it's harder to optimize than the dispatch_switch. TIA. -regards, Larry -[---- cut he... 6 Jul 2010 14:28
Creating new codecvt facets
I am the author of a Unicode library that does code conversion at the iterator level, and I would like to adapt my codecs to make them work as codecvt facets usable with file I/O. While it works to subclass std::codecvt<char, char, std::mbstate_t> and std::codecvt<wchar_t, char, std::mbstate_t> for that purpose, ... 7 Jul 2010 09:02
State of N2801: initializer lists and move semantics
Hello, I'd like to know the current state of N2801, is there plans to include it into FCD or another solution to the problem involved, or we won't have initializer lists with move semantics in C++0x? Regards, Rodolfo Lima -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lan... 4 Jul 2010 17:43
enforcing const overload of a method
Please take a look at this code: class A { public: template<class XIter> A(const XIter begin, const XIter beyond) {} }; #include <vector> int main(int argc, char* argv[]) { std::vector<int> integers; A a1( integers.begin(), integers.end() );//No problem std::vector<int>::const_iter... 6 Jul 2010 22:13
Job for Boost filtered iterators ???
Hi I have a POD struct in a vector and there are 4 counts I am interested in. It works out that pair of iterators mark the beginning and end of "Channel" events and that one of members of the struct, bool indicates if this channel event has "AI". It is also possible that several Channel "events" (call it it a... 2 Jul 2010 21:14
Cv-qualification as a template parameter
Sometimes we need to duplicate code for cv-unqualified and cv- qualified types. For example, there is no way to specialize the following template template <class T> struct X; for any pointer type at once. We have to write 4 partial specializations as shown below: template <class T> ... 11 Jul 2010 14:50
Available C++ Libraries FAQ
Available C++ Libraries FAQ URL: http://www.trumphurst.com/cpplibs/ This is a searchable list of libraries and utilities (both free and commercial) available to C++ programmers. If you know of a library which is not in the list, why not fill in the form at http://www.trumphurst.com/cpplibs/cppsub.php Main... 2 Jul 2010 16:50
Pass by reference or const pointer? When to choose what?
Hi When will you choos to pass by reference over const pointer and vise versa? And why can't a copy constructor be declared like A(const A* const p) instead of A(const A& r) (any reason other than "it had to be one way", i mean any technical / language limitation? If we had a previous discussion on this top... 2 Jul 2010 20:09
First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21