Is there a way use STL containters with non-copyable elements?
something like this:
class noncopyable
{
noncopyable(noncopyable&);
const noncopyable& operator=(noncopyable&);
public:
noncopyable(){};
};
int main()
{
list<noncopyable> MyList; //error C2248: 'noncopyable::noncopyable' : cannot access private member decla...
I'm new to c++. I made a c++ program using VS 2008 Professional. I started with the Win32 template that created a window for me. I compiled it on Vista 32. I brought the compiled exe to my old XP sp2 computer, and it tells me the application configuration is incorrect. Is there something im doing wrong? How do I make it platform independ...
Suppose that we have the following base and derived classes:
#include <string>
#include <iostream>
class Car {
public:
void Drive() { std::cout << "Baby, can I drive your car?" << std::endl; }
};
class Porsche : public Car {
};
..and also the following template function:
template <typename T, typename V>
void Function(void (T::...
In my C++ project, I have a convention where whenever the macro DEBUG is defined, debugging printf-esque statements are compiled into the executable.
To indicate whether or not I want these compiled into the executable, I normally would pass the macro name to gcc with the -Dmacro option. So, in the Makefile I (currently) have:
CXXFLAG...
Hello,
I am new to Windows CE programming.
I have Visual Studio 2008 and Visual Studio 2005. I have found the following SDK for Windows Mobile
http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en
Please help me in deciding if this is the correct one, or please feel free to ...
What would be the value of Field.Format("%04d", ErrorCode) in the procedure below if the AErrorCode is ERR_NO_HEADER_RECORD_FOUND_ON_FILE?
Somewhere in a .h file:
enum AErrorCode
{
ERR_UNKNOWN_RECORD_TYPE_CODE = 5001,
ERR_NO_HEADER_RECORD_FOUND_ON_FILE,
ERR_DUPLICATE_HEADER_RECORD_FOUND,
ERR_THIRD_PARTY_LETTER_RECORD_H...
Why does the root directory of a process, started by a windows process manager, change to the directory of where the pm is located?
Using msdn process manager code to create a pm service to run a few exes.
The exes save log files in the root relative to their location.
When started by the process manager, they are saving to the process...
I am looking for a solution which would allow me to code for Linux and Windows using C++.
On Windows I use Visual Studio (I tried other stuff on Windows but I work with DirectX and as far as I know, it's the best solution).
On Linux I use NetBeans (which I like very much).
My problem is that I want the project be independent of Visual...
I am new to the generic geometry library that is proposed for inclusion with boost:
http://geometrylibrary.geodan.nl/
I have two vectors vector<int> Xb, Yb that I am trying to create a polygon from. I am trying to get something along the lines of the following code snippet:
polygon_2d P;
vector<double>::const_iterator xi;
vector<...
What fields of getrusage do I use in order to check for memory leak on HPUX (what is the parallel to RES in 'top')?
...
Hey guys i have some quick questions on windows dll.
Basically i'm using the ifdefs to handle the dllexport and dllimport, my question is actually regarding the placement of the dllexports and dllimports as well as extern keyword.
I am putting the dllimports/dllexports on the header files but do I have to put the dllexport and dllimpor...
I wrote a drawing function that draws various on-screen sprites. These sprites can only overlap up to a point. If they have to much overlap, they become too obscured. As a result I need to detect when these sprites are too much overlapped. Luckily, the problem is simplified in that the sprites can be treated as orthogonal rectangles. I'd...
Hello,
I would like to ask if anyone knows how to display 2 QToolBars in two lines, one on top of the other? I found the class QStyleOptionToolBar, but I don't know how to use it...
It is easy to drag one toolbar with the mouse to be placed below the other, so I think there must be a way how this can be done from the source code as wel...
Does anyone know of a C++ unit-testing framework (e.g. CppUnit, Google Test, etc.) that can be used to write tests on z/OS?
I do most of my development on Windows using the Dignus C++ compiler, which you can use as a cross-compiler and generate object code to run on z/OS. I tried writing a sample test using Google Test, but the compile...
I'm building a c++ tetris game (not c++ .Net). I feel my controls are weird. I want to make it so that when user presses one of the arrow keys, about 10ms of holding it down will start the repeat function windows has. It is set to about 500ms by default, and it is too laggy for my game. How can I set the speed at which it changes from th...
C:\Projects\Logs\RTC\MNH\Debug
C:\Projects\Logs\FF
Is there an expression/string that would say go back until you find "Logs" and open it? (assuming you were always below it)
The same executable is run out of "Debug", "MNH" or "FF" at different times, the executable always should save it's log files into "Logs".
What expression wou...
Hi,
I'm writing a DLL for a very old program that was compiled using Visual Studio 6. This program exports some functions that return pointers to standard library containers, and I'm (unsurprisingly) running into problems when I attempt to do anything with them from my DLL, which is compiled under VS 7. The source code for the program i...
I am using Luabind to expose a base class from C++ to Lua from which I can derive classes in Lua. This part works correctly and I am able to call C++ methods from my derived class in Lua.
Now what I want to do is obtain a pointer to the Lua-based instance in my C++ program.
C++ -> Binding
class Enemy {
private:
std::string name;
pu...
Has anyone used a package like CppUnit to cross-compile C++ unit tests to run on an embedded platform?
I'm using G++ on a Linux box to compile executables that must be run on a LynxOS board. I can't seem to get any of the common unit test packages to configure and build something that will create unit tests.
I see a lot of unit test p...
How can I move away from (in c++) the annoying menus like:
(a) Do something
(b) Do something else
(c) Do that 3rd thing
(x) exit
Basically I want to be able to run the program then do something like "calc 32 / 5" or "open data.csv", where obviously I would have written the code for "calc" and "open". Just a shove in the right direction...