First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
templates and default parameters
I contend that the following code should not compile. However, on various compilers with varying versions of the EDG front end, it either crashes the compiler, compiles. or fails to compile. Am I correct that this code is ill-formed? template <typename F> inline void call(F func) { func(); } void routine(i... 16 Jul 2010 18:46
Template instantiation question
The code below compiles without error, but I think the static_assert should trigger: --------------------------------------------------------------------- struct test_default { }; namespace test_template1 { template < class T1, class P1_1, class P1_2 char test(typename T1::t... 16 Jul 2010 18:46
Distinguish between pointers created with 'new' and created with references.
On 15 Jul., 14:03, dailos <dailos.guerr...(a)gmail.com> wrote: I am struggling with a design problem. It showed up because of some architectures constraints. I have a group of classes which derive from an abstract one. I have a vector with pointers to the generic abstract class (neither vector of reference... 15 Jul 2010 20:54
Distinguish between pointers created with 'new' and created with references.
On Jul 15, 2:03 pm, dailos <dailos.guerr...(a)gmail.com> wrote: Hi all, I am struggling with a design problem. It showed up because of some architectures constraints. I have a group of classes which derive from an abstract one. I have a vector with pointers to the generic abstract class (neither vector ... 16 Jul 2010 12:06
Distinguish between pointers created with 'new' and created with references.
dailos wrote: Hi all, I am struggling with a design problem. It showed up because of some architectures constraints. I have a group of classes which derive from an abstract one. I have a vector with pointers to the generic abstract class (neither vector of references nor vector of classes are allowed ... 16 Jul 2010 12:05
Constant Time std::vector Item Removal
I used to call vector.remove(it+i) to remove the i-th position element in a STL vector, but this causes a O(n) shifting of objects past the deleted item: std::vector<ObjType> vec; ..... // fill with items vec.erase( vec.begin() + pos ); // remove ith pos item Recently, I've been getting good results by si... 4 Aug 2010 22:20
Distinguish between pointers created with 'new' and created with references.
Hi all, I am struggling with a design problem. It showed up because of some architectures constraints. I have a group of classes which derive from an abstract one. I have a vector with pointers to the generic abstract class (neither vector of references nor vector of classes are allowed since it's abstract). A m... 15 Jul 2010 20:54
Perfect forwarding of default constructor?
Suppose I need a template that encapsulates an object, and I need the ability to construct the template instantiations in all the ways that the encapsulated object can be constructed. A possible construction may be: template <typename T> class wrapped { public: wrapped() {} template <typename U> wrapp... 18 Jul 2010 15:56
Current time based on a timezone?
Hi, I am trying to get the current time based on an input timezone with the consideration of daylight saving, and do some simple arithmetic (e.g. "add" 1 day to or "subtract" 1 day from it), Is there a function like that in std C++? I have searched online for awhile...I don't see any (besides boost)...maybe... 18 Jul 2010 15:56
overloading for multiple arithmetic operations
Hi, I would like to add multiple objects of a class with integers/ floats. Need some basic help in fixing an error Eg: #include<iostream> using namespace std; class Test { public: Test(float _code){ code = _code;} Test(){} float code; friend Test operator+(Test & ob, f... 16 Jul 2010 12:06
First  |  Prev |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18