First  |  Prev |  Next  |  Last
Pages: 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
enum v.s. static function in template class: which one is better ?
On Dec 27, 11:11 am, Alberto Ganesh Barbati <AlbertoBarb...(a)libero.it> wrote: Lizax ha scritto: I want to implement a template like this: template<typename T, int id> struct Foo { typedef T Type; enum { value = id }; }; Pros: value can be used whenever a constant e... 28 Dec 2007 14:43
Templates and inheritance: Double dependancy
Hi all. I am trying to implement a red-black binary tree in terms of of an overloaded binary tree class. The base binary tree class represents the nodes as template <class T> class BinaryTreeNode { T Key_; /* internal fields needed to maintain the tree */ }; template <class T> class BinaryTree ... 4 Jan 2008 13:30
an intrusive smart pointer
hi, I am using an adhoc intrusive templated smart pointer implementation and I stumbled upon a small implementation quirk. details: - intrusive: requires Ref and Unref to be defined on target type - assumes refcount is initialized to one by constructor of target type The above details make it impossible... 6 Jan 2008 11:10
typedef in template class ---GCC3.4.5 vs MSVC8
Code like below: template<class T> struct A { typedef T t_type; }; template<class T> struct B:public A<T> { void foo(t_type i) {} }; int main() { B<int> b; b.foo(0); return 0; } This code can be compiled in MSVC8, but not in GCC3.4.5, and the error message is :"t_type has not been declared... 29 Dec 2007 17:52
Duplicate output from stringstream
Hi, I'm using a stringstream to read patterns from a string, where a string may look this this: "M 1,0 L 0.6,1.2 L 0,1 L 0.5,2 L 1,1.75 L 1.5,2 L 2,1 L 1.4,1.2" Here I'm trying to extract the number pairs, skipping the letters and commas. This is how I'm doing it: ----- double x, y; char ch; ist... 1 Jan 2008 13:32
enum v.s. static function in template class: which one is better?
Michael Aaron Safyan ha scritto: 1.) The enum version is often written as: template<typename T, int id> struct Foo { typedef T Type; static const int value = id; }; You may see this as a different version of the enum case, but it's not. An enumerator is always an rvalue and has a ... 28 Dec 2007 10:37
What the program would behave if an exception is thrown in an environment with exception disabled
cppcraze wrote: Hi Guys, I work in an Embeded community in which exception has been disabled, though I recommend using exception, that is out of my control. Now I have a question: in such a scenario (I mean exception has been disabled), what if some classes defined by C++ library throw some excepti... 28 Dec 2007 11:12
What the program would behave if an exception is thrown in an environment with exception disabled
cppcraze wrote: I work in an Embeded community in which exception has been disabled, though I recommend using exception, that is out of my control. Now I have a question: in such a scenario (I mean exception has been disabled), what if some classes defined by C++ library throw some exceptions, for exampl... 29 Dec 2007 15:38
What the program would behave if an exception is thrown in an environment with exception disabled
Hi Guys, I work in an Embeded community in which exception has been disabled, though I recommend using exception, that is out of my control. Now I have a question: in such a scenario (I mean exception has been disabled), what if some classes defined by C++ library throw some exceptions, for example, std::string ... 1 Jan 2008 12:26
enum v.s. static function in template class: which one is better?
Lizax wrote: I want to implement a template like this: template<typename T, int id> struct Foo { typedef T Type; enum { value = id }; }; or template<typename T, int id> struct Foo { typedef T Type; static int value() { return id; } }; which one is bet... 3 Jan 2008 18:12
First  |  Prev |  Next  |  Last
Pages: 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88