|
C++ language: Cloneable classes I'm working on a Cloneable concept for C++ classes. Here's what I think it should be like, however it doesn't compile :? #include <memory> class CloneableBase { public: virtual ~CloneableBase() {} private: virtual CloneableBase* doClone() const = 0; }; template < typename Derived > class Clonea... 7 May 2008 11:35
wide codecvt not used unless sync_with_stdio(false) Hi! I'm facing a problem with the following code that uses a custom codecvt facet for wide streams. The facet is taken from Boost (actually a recent svn trunk checkout, but the considered code did not change a while, a 1.34 or 1.35 release would do) and converts wchar_t internally and UTF-8 externally. #inclu... 7 May 2008 11:35
Duplicate symbols combined without warning Hi! Not really sure where to post this, maybe the gcc list instead? Anyway, if I have two cpp files with identical class declarations (but with different semantics) of an internal class, and link them together, one of the implementations get thrown out without any kind of warning. Simple example: foo.cpp... 7 May 2008 11:35
Adapting code for C++98 compliance. I'm a very competent and experienced C programmer, with a pretty good understanding of C++98. I haven't kept up very well on the changes that have been made since C++98, but for the code I'm talking about, C++98 is the relevant standard. I used to participate frequently in comp.std.c++, (literally thousands of post... 7 May 2008 11:35
C++ Memory Management Innovation: GC Allocator On Apr 21, 10:43 pm, marlow.and...(a)googlemail.com wrote: On 21 Apr, 19:13, xushiwei <xushiwe...(a)gmail.com> wrote: I took a quick look with particular interest in what you have to say about scoped allocators. It seems to me that there is some overlap with what you are doing and the work by Pablo Halpern i... 7 May 2008 11:35
How to build a string on the fly, using std::ostringstream? Does the Standard Library support creating an std::string by means of streaming, without having to declare a *named* ostringstream object? I tried the following: #include <sstream> #include <string> int i = 42; std::string s = (std::ostringstream() << "i = " << i).str(); Of course it didn't co... 7 May 2008 11:35
How to convert a pointer to member function type to a const member one On 1 May, 21:43, mcostalba <mcosta...(a)gmail.com> wrote: I have to detect if a functor type Fun has a given signature Sig, i.e. if Fun::operator() has a signature Sig Take a look at is_call_possible metafunction, which was discussed in this group before (http://groups.google.com/group/comp.lang.c++.moderated/... 7 May 2008 11:35
How to convert a pointer to member function type to a const member one On 5 Mag, 15:09, "Roman.Perepeli...(a)gmail.com" <Roman.Perepeli...(a)gmail.com> wrote: On 1 May, 21:43, mcostalba <mcosta...(a)gmail.com> wrote: I have to detect if a functor type Fun has a given signature Sig, i.e. if Fun::operator() has a signature Sig Take a look at is_call_possible metafunction, w... 7 May 2008 11:35
some quirks of Koenig lookup rule? Hi Can someone explain this peculiar behavior of MSVC & GCC: code below, if you uncomment that line (which is totally unrelated to 'dph' class), will stop compiling with usual bizzare C++ error [code] #include <iostream> namespace AAA { struct gad { }; //std::ostream& operator<<(st... 7 May 2008 11:35
sorting criteria (understanding) Hi, unfortunately I have lost the link to the anwer of the question: "Why is the functor of a std::sort copied several times?" What's the reason for this handling? I have written a template adapter to use a given object providing the required sorting criteria so the concrete instance does not get copied and... 7 May 2008 11:35
Template function problem language or compiler bug? Hi, I found a bit of a weirdo using Intel 4.5 compiler & I've seen similar bad stuff in VC6. I don't know if it is a language 'feature' or a bug in the compiler's template handling - the compilers are old. Basically I have a template function (as a member in a class) with void return & argument. To use the fun... 7 May 2008 11:35
templates - partial specialization Hello All, I was trying to execute couple of examples to understand the partial template specialization concept. Here is one among those. #include<iostream> using namespace std; template<class T> class my_vec { public: my_vec(){std::cout<<"im class my_vec<class T> \n";} }; template <cl... 7 May 2008 10:47 |