First  |  Prev |  Next  |  Last
Pages: 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
why don't the STL containers all inherit from a common container class to allow generic iteration?
Andrew wrote: Subject says it all really. A common baseclass and virtual functions require a certain overhead which is paid for just dereferencing or stepping an iterator. That overhead is unacceptable to the STL philosophy, which had efficiency as a major goal. I realise that in the upcoming standard the ... 8 Dec 2009 21:56
C++ library that offers tensors?
Does anyone know of a C++ library/package/project that offers tensors please? I happen to want them for quantitative finance but they surely must of be of interest to mathematicians generally. There is talk of them in Blitz++ but details are very sparse and Blitz++ does not seem to have been updated in years. I ... 8 Dec 2009 21:56
Fast Assignment of POD Struct Whose Members Have Copy Constructors
On Dec 7, 1:55 pm, Goran Pusic <gor...(a)cse-semaphore.com> wrote: On Dec 6, 1:07 am, Le Chaud Lapin <jaibudu...(a)gmail.com> wrote: Certain x86 memory movement instructions are much faster than calls to memcpy, which simply employs those same instructions internally along with unnecessary overhead. Ba... 9 Dec 2009 18:52
std::map element in heap or stack?
Dear All, I am wondering the inserted element in std::map is located in heap or stack? For example std::map<int, double> a; a[0] = 3.14; The element of the map: pair<int, double>(0, 3.14) is in heap or stack? I think to know it is important for memory management. Thank you a lot ahead, Shuisheng --... 11 Dec 2009 00:28
Need to analyze C source code and determine loops (program analysis)
For our project, we need to analyze C source code (our input) and determine where or not a for loop exists (so we can add OpenMP directives beforehand if it will help). How would you recommend we do this? Our current approach is a string parser but we do not know in detail better approaches that might exist such as... 10 Dec 2009 01:26
why don't the STL containers all inherit from a common container class to allow generic iteration?
> Subject says it all really. I have been in Javaland for a while where you do have this capability. I am aware of Meyers Effective STL item 2 ("beware of the illusion of container-independent code") but I don't think item 2 applies when all you want to do is iterate over a container. This is the simple cas... 8 Dec 2009 21:57
C++ analog of setvbuf() ?
Is there a C++ analog for setvbuf()? Is there a way to set line buffering for stdout other than calling 'endl' ? As I understand, cout is line buffered for as long as the output goes to a terminal device. cout becomes fully buffered as soon as it loses terminal. Will 'endl' ensure line buffering for an applicatio... 10 Dec 2009 10:04
bitmask generation
I have some macros that use the construct '~((-1) << (WIDTH))' to generate masks. I was informed that left-shifting a signed negative value is undefined behavior, and recommended that I replace (-1) with (~0UL). I'm not familiar with the standard, so can someone explain this more? -- [ See http://www.g... 9 Dec 2009 18:52
C++, C99 and floating point exceptions
I have heard that C99 has floating-point environment functions and that the upcoming C++ std will also have them. Can someone please give me a reference for this? Was this part of TR1? I don't remember it being there and I did take spend a while looking at TR1. I am interested in how to handle floating point excep... 7 Dec 2009 15:06
Fast Assignment of POD Struct Whose Members Have Copy Constructors
On Dec 5, 6:06 pm, "Kenneth 'Bessarion' Boyd" <zaim...(a)zaimoni.com> wrote: Foo & operator = (const Foo &that) { if (this == &that) return *this; cout << "\nInside assignment operator ...\n" << endl; memset(this,&that,sizeof(Foo)); return *this; } s/memset... 6 Dec 2009 16:08
First  |  Prev |  Next  |  Last
Pages: 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61