One question about table driven and function pointer Hi I need to associate a string with a function. I define the following table struct COMMAND { const WCHAR * name; void T::*proc(int); }; static const COMMAND commands[] = { {"north", fun0}, {"east", fun1}, {"south", fun2}, {"west", fun3}, }; However I would l... 5 Nov 2009 14:30
An stl list of function pointers In my project I want to create a list of functions that I am going to iterate over and call sequentially. Im not quite sure how to define an stl list of function pointers. #include <list> my best guess that is wrong. list<void(* functionName)(int id,void *message)> functionList; -- [ See http://www.... 4 Nov 2009 16:23
STL slower than C [ATTN: Scott Meyers] "Antonio P�rez Barrero" <apbarrero(a)gmail.com> wrote in message news:6aee09c8-2a27-45db-888a-155477797bd2(a)j4g2000yqe.googlegroups.com... ... I'm also curious as to which programming idioms can improve STL efficiency. Best reference on the matter: Scott Meyyer's "Effective STL" (http:// www.amazon.co... 5 Nov 2009 14:30
static_cast<unsigned equivalent>(signed type); Hi All, Do I get any guarantee that the unsigned version of a corresponding signed type is: 1. the same size as the signed version 2. equivalent to the signed version as far as the bit pattern is concerned I especially would like to know if the standard prevents the compiler from changing the bit pattern f... 8 Nov 2009 16:18
Check .lib is complete Hello, Is there a simple way to check that a C++ lib is complete, that is that it does not have any external dependencies? Thanks, Louis. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 8 Nov 2009 16:18
Announcement: Enhanced search engine for C/C++, with Firefox/IE search bar plugin. Organization: http://groups.google.com References: <c8a95f59-6198-42bf-b8b3-fcc43d9895df(a)g1g2000vbr.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 X-Clcppm-Sequence: 28572 X-Original-Date: Sun, 1 Nov 2009 23:26:20 -0800 (PST) X-Submission-Address: c++-submit(a)netlab.cs.rpi.edu ... 2 Nov 2009 11:12
Standard library pop() Why is there no variant of pop() in the standard library that returns the top element? I can understand why there is a void pop() - for efficiency. But why isnt there also a variant that returns the top element - bool pop(T&), so that those who want to use it can? It'd be so much simpler to write a routine while (x... 4 Nov 2009 06:23
Simplester MetaLoop Now that I'm rewriting all applicable nested loops as template versions, I asked myself: why do I need to separate the base and inductive cases into two lexically separate template constructs? The "Hello World" that I'm building on looks something like this: template<int i> struct Loop1 { static inline void f... 2 Nov 2009 16:49
Simplest MetaLoop I've written a simple template metaprogramming loop (below) using a struct template which requires a loop index, and two function signatures; one for the base (zero) case, and one for the inductive (ith) case. As you can see below, I start things off with a call like this: Loop2<double (*)(double), void (*)(int... 30 Oct 2009 02:25
Is this correct C++? Hello, today I was searching for over an hour for the reason of a compiler error after a change I made (finally I found it). That was really a strange error! I do not know, if the "original" code was legal C++. Here an example: class A { public: A(), // Notice the comma instead of a semicolon! A(int i)... 25 Oct 2009 15:21 |