information for find can i do like this...?? s=buffer; f=s.find( "{{" && "==" && "<=" && "<=" && "}}" ); s.erase(f); -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 20 May 2010 23:45
how to pass polymorphic container classes Hi all, the following code isn't compiling: template<class T> class containerBase { }; class aBase { }; class aDerived : public aBase { }; void aFunc(containerBase<aBase*>& aContainer) { } void aTestFunc() { containerBase<aDerived*> lContainer; aFunc(lContainer); } The comp... 20 May 2010 23:45
restriction on inheritance Is there any way at compile time to restrict direct inheritance from a class to no more than once? Thanks for any insight. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 25 May 2010 14:37
Converting from int** to vector< vector<int> >& I'm trying to rewrite some code that used arrays and pointers like this: void calculate_table(size_t rows, size_t columns, int *raw_data, int **table) { //initialise the elements of table to zero. //then save the results of calculations on the elements of raw_data in it } so that it will use the standard... 19 May 2010 11:32
why should you use c++ in such project ? I read all over the web about how scripting programming languages (like ruby or python) are fast for writing programs quickly. so i would like you to consider a programming project that is : 1- the length of source code is in the magnitude of few hundreds to few thousands lines of code. 2- not a low level (drive... 19 May 2010 18:14
Assignment operator definition required in case of reference data member why? On 14 May, 16:51, "Daya S. Prasad" <mail....(a)gmail.com> wrote: Consider a code: class B { }; class TestClass { B &obj; public: TestClass(B &refObj) : obj(refObj) { cout << "Called ... TestClass(B &refObj)\n"; } TestClass & operator=(TestCl... 15 May 2010 18:04
Assignment operator definition required in case of reference data member why? On May 14, 10:51 am, "Daya S. Prasad" <mail....(a)gmail.com> wrote: [snip] error: non-static reference member 'B& TestClass::obj', can't use default assignment operator note: synthesized method 'TestClass& TestClass::operator=(const TestClass&)' first required here Can anybody please tell me exactly... 14 May 2010 18:18
[temp.arg.nontype] and & of non-static class members In [temp.arg.nontype]/3 (which is, admittedly, a non-normative note) it says: "...names or addressess of non-static class members are not acceptable template-arguments." and then goes on the give some example code in relation to various attempted instantiations of: template<int* p> class X { }; ... 14 May 2010 11:40
Assignment operator definition required in case of reference data member why? Consider a code: class B { }; class TestClass { B &obj; public: TestClass(B &refObj) : obj(refObj) { cout << "Called ... TestClass(B &refObj)\n"; } TestClass & operator=(TestClass const &) { cout << "Called ... TestClass & operator=(TestClass const &)\n"; return *this; } ~TestClass() { co... 14 May 2010 18:18
cloning struct and derived structs with primitive type members Hello, I have struct params { double field1; double field2; virtual ~params() {} }; struct params1 : public params { double fielda; double fieldb; }; I have dozens of structs derived from params. I work mostly with params& and params* and const versions. Given a const params&... 17 May 2010 13:30 |