deep/real copy of derived objects1123 (8/19/2010 11:11:36 PM) comp.lang.c++ Hello I have a base struct B from which 2 struct D1 and D2 derive publicly. A 3rd struct D3 derives from D1. This is data aggregation. A "manager" class needs to store copies of these objects when its ctor ... Hicham
default contructing an object of unknown type T32116 (7/30/2010 10:03:56 AM) comp.lang.c++ Hello,
inside a template function, I need an instance of type T that is to be
default constructed.
I would normally write:
template
void f(const T&) {
const T t();
}
This then requires T to ha... Hicham
Generating a derived class from a base class3152 (6/21/2010 4:40:22 PM) comp.lang.c++.moderated Hello,
I have a base class with a number of pure virtual functions.
I will have to write a large number of derived classes and I wish to
generate the derived class definitions programmatically as containin... Hicham
std::memset, std::fill, hand-written for loop20252 (5/31/2010 9:10:27 AM) comp.lang.c++.moderated Hello,
Are there any articles comparing the cases/reasons when/why to use memset vs
fill, vs writing a loop by hand?
Regards,
--
[ See http://www.gotw.ca/resources/clcm.htm for info abou... Hicham
filtering (a view on) an STL container5197 (3/10/2010 1:15:12 PM) comp.lang.c++.moderated Hello,
I have in input an STL container say std::vector or std::list called
my_container;
Is there any advised style re filtering such a container, so that following
code can work only on a subset of ... Hicham
"partial" iterator?5115 (9/3/2010 2:39:20 AM) comp.lang.c++ Hello,
I have a std::map>.
I often lookup based on the key (std::string)
I have a use case where I want to iterate over all the map except for keys
that begin with "RF".
I could iterate and check if... Hicham
deep/real copy of derived objects1123 (8/19/2010 11:11:36 PM) comp.lang.c++ Hello I have a base struct B from which 2 struct D1 and D2 derive publicly. A 3rd struct D3 derives from D1. This is data aggregation. A "manager" class needs to store copies of these objects when its ctor ... hicham(107)
default arguments for class member template function415 (9/15/2009 6:51:19 PM) comp.lang.c++ Hello, I am debugging (vs2008) the following code: I type the URL weirdly here because I think messages with URL are rejected: h t t p : / / codepad . org / zy3WFbe7 Please ignore all spaces when you paste ... hicham(107)
SVO323 (9/11/2009 11:06:37 AM) comp.lang.c++ Hi, I have data that looks like: x f(x) ------ --------- 0.5 7.8 0.9 6.7 -5.4 6.6 0.0 6.6 1.5 7.8 The number of points is variable bu... hicham(107)
enum names inside a templated class313 (8/7/2009 11:54:58 AM) comp.lang.c++ hi, template struct C { typedef typename Traits::E1 E1; .... static void f(); }; template::f() { // E1 is an enum { x1, x2... } in this case // I wanted to use x1 x2 ... without scoping // 1. ... hicham(107)
switch statement to detect handling of ALL derived classes1315 (8/3/2009 7:58:51 AM) comp.lang.c++ Imagine we have an abstract base class ABC and derived classes D1, D2, ... Dn I am being told a code pattern to "enforce" all cases are handled is such: enum ABCTypes { D1Tag, D2Tag, .... DnTag }; const AB... hicham(107)
contiguous in memory1915 (4/30/2009 3:33:34 PM) comp.lang.c++ void f() { auto v1; auto v2; // consecutive in source code .... } Are there any guarantees by c++ that the 2 auto variables are such that &v2 == &v1 + sizeof(v1) ? are they contiguous? if not, my q... hicham(107)