November 30th, 2012 08:30 AM
I did not know about the warning level. I made the change.
Also, I read about lvalue and rvalue and now understand more what is going on. I would like to mark the argument as const but in the real...
November 29th, 2012 08:45 AM
The below code compiles without error using VS 2012 but with g++ 4.1.2 I get this error:
main.cpp: In function 'int main(int, char**)':
main.cpp:37: error: no matching function for call to...
October 15th, 2012 03:56 PM
October 15th, 2012 03:22 PM
In this code snippet what does the line (line 20) that reads
else ;
cause to the flow of the program, if anything? If it does nothing why would someone have it there?
April 18th, 2012 08:30 AM
I am attempting to use C code from C++ and am having trouble sharing a struct between the two languages.
Currently I am able to get everything to compile by defining the struct in both the C++...
February 17th, 2012 03:35 PM
Thanks for everyone's help. I was so focused on finding an algorithm to do this in one call I didn't think to copy then erase.
Once again thank you guys for your help.
February 17th, 2012 03:20 PM
Is your example only removing the elements from dataQ that are copied to data_array?
I see
dataQ.clear()
But that will drop all elements not just what was copied with std::copy. Or...
February 17th, 2012 02:31 PM
I'm not taking all of the data from the dataQ only what is requested by the caller of the function. The size variable is the amount of data requested by the caller. Int he real code data_array is a...
February 17th, 2012 02:03 PM
Is there an algorithm in the STL to move elements similar to how std::copy works? I have read various places that the new C++ standard has a move algorithm. Unfortunately the compiler I use (g++...
January 27th, 2012 07:33 AM
Usually setter functions take a const reference and return void.
For example:
void person::set_person(const string& n)
{
...
}
January 29th, 2011 07:24 AM
Hi Everyone.
I'm getting a few messages like this from the gcc (version 4.1.2) compiler.
[cc] /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_construct.h:81:...
March 16th, 2010 02:36 PM
Why does the following code not break after delete bar? It seems like the object foo would have a reference to a deleted object and crash in printBar(). Is bar not really gone after the "delete bar"...
December 8th, 2009 02:34 PM
In general what are the additional or special things to be concerned about and watch out for when making a multi threaded app run correctly on a multiple CPU machine?
I remember from a while back...
September 15th, 2009 12:50 PM
I figured it out.
I ended up adding a template parameter to ProcessingQueue and using that as the thrid template parameter to std::priority_queue.
I created a default Comparer with the signature...
September 15th, 2009 12:01 PM
I was expecting the user to supply the comparison function at compile time. My theory was that they would derive a class from Comparer and override operator().
Either was is probably okay as the...
September 15th, 2009 10:38 AM
I have a template class that contains a std::priority_queue and would like for the user of this class to be able to pass in the functor object that is used for comparison. Here is the code I have but...
February 4th, 2009 07:52 AM
Do you mean the linker is trying to find libXyz.so or the .so that the some_symbol is defined in?
Thanks for your help.
February 4th, 2009 07:31 AM
Hi Everyone,
In general what is the following linker error indicating?
/app/lib/libXyz.so: undefined reference to `some_symbol'
Using g++ compiler on Linux.
I get multiple of these all...
November 12th, 2008 09:57 AM
Hi Everyone,
I have a physical data model in Rose Data Modeler and ERwin. I would like to generate CRUD operations in Java but do not see an option for this in either Rose or ERwin.
Is there...
October 21st, 2008 02:13 PM
Hello Everyone,
I would like to return a pointer to an object that is found in a set. Here is the code:
#include <cstdlib>
#include <iostream>
#include <string>
#include <set>
April 11th, 2008 09:47 PM
The issue here is that the base class has no implmentation for the overloaded operator functions, only a declaration, so I don't see how they could be called by the derived object.
So I'm...
April 11th, 2008 02:56 PM
Graham,
The sample code I posted had no implementation for the non-virtual functions which is why I was questioning the purpose of them.
I'm still not exactly sure. I'll re-read laserlight's...