First  |  Prev |  Next  |  Last
Pages: 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
Hi, I need to perform a remove_if algorithm on a boost::ptr_vector. I am using boost::ptr_vector to store types that have no copy or clone operation. std::remove_if doesn't work due to the lack of copy/clone operations. So I wrote my own function. It is possible to write it in many ways, but any solution I can thi... 20 Dec 2009 23:26
comparing iterators
Lately I stumbled upon operator> in this context: std::vector<int> container(10); // filling vector omitted std::vector<int>::iterator itr = std::lower_bound(container.begin(), container.end(), somevalue); if (itr > container.begin()) { ... } This compiled w/o problems, but since we use operator != in ... 19 Dec 2009 12:42
Code Optimization
hi all, Can anybody please let me know how compiler optimize a C++ code? can you give me a simple example? which will help me to write more optimized code in all my working projects. Thanks & Regards, Sadanand -- [ See for info about ] [ comp.lang.c++.moder... 6 Jan 2010 08:30
extern versus #include
Hi all! From time to time, I find myself using extern declaration for small utility functions used sparsely in different places in the code base (e.g. having it in one *.cpp, but also calling it in one/two others). It's itching me somewhat. A text book would recommend having a header containing relevant externa... 19 Dec 2009 10:30
Stack overflow using boost::operators
Hello all, while using boost::operators I bump into a stack overflow. IField is a template wrapper, I cleaned it from other distractions so for now it looks a bit vinyl, but in my regular code all operations are managed through visitor pattern (I emitted it here because it is not relevant to my problem - just ... 21 Dec 2009 11:15
ISO C++ forbids initialization in array new
Im not specialized in c++ but I have application written in c++ I have to compile and run for research purposes. the g++ compiler (version 3.4) gives me this error iq_router.cpp:32: error: ISO C++ forbids initialization in array new this is the line of code where I get this error _vc[i] = new VC [_vcs] ( ... 20 Dec 2009 03:51
Factories, handles, and handle wrappers
Let's say you have a factory which returns handles to objects that it allocates. You pass these handles to the factory whenever you want to use the object or destroy it. The factory's "OperateOnObject" class verifies that the handle is within its object collection, and then marshals the OperateOnObject call to the... 21 Jan 2010 06:42
[ANN] CLI 1.1.0 released
Hi, I am pleased to announce the availability of CLI 1.1.0. CLI is an open-source (MIT license), cross-platform command line interface compiler for C++. It allows you to specify the options that your program supports, their types, default values, and documentation. This specification can then be automatically ... 15 Dec 2009 20:02
Temporary used for parameter
Hi I have this code: // trim from start static inline std::string & ltrim( std::string & s ) { s.erase( s.begin(), std::find_if( s.begin(), s.end(), std::not1( std::ptr_fun<int, int>(std::isspace) ) ) ); return s; } // trim from end static inline std::string & rtrim( std::string & s ) ... 19 Dec 2009 10:30
MinGW - Variadic Templates - no matching function for call.
I am attemting to compile the code below, using MinGW on windows, as below: g++ -std=c++0x -Wall -Os -o varTest varTest.cpp I receive the following compilation error: In file included from d:\apps\qt\2009.05\mingw\bin\../lib/gcc/ mingw32/4.4.0/incude/c++/bits/postypes.h:42, from d:\apps\qt\2009.05\mingw\bin\..... 15 Dec 2009 11:07
First  |  Prev |  Next  |  Last
Pages: 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58