I have g++ 4.4.3 on Linux with Ubuntu Lucid Lynx, and I am getting a:
-nan
as a result. On Hardy Heron with g++ 4.3.1, I am getting all
nan
This is causing my text diff regression to fail, since I am using cout to print this numerical result.
What is the meaning of a signed nan, and is there a way to tell the compiler that an unsig...
Is it possible to capture by const reference in a lambda expression?
I want the assignment marked below to fail, for example:
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string strings[] =
{
"hello",
"world"
};
static const size_t num_st...
I need to temporarily disable a few items from an accelerator table when the input focus is on a CEdit field.
My application has some commands associated with keyboard keys (A, S, D, etc.) and I need to disable those while the user is entering text in the field.
...
I hope this is not a duplicate question, but if it is, feel free to point me in the right direction.
I have a vector<vector<int> >.
Is it possible to use unique() on this? Something like:
vector<vector<int> > myvec;
//blah blah do something to myvec
vector<vector<int> >::interator it = unique(myvec.begin(), myvec.end());
Would the r...
I'm trying to make a function template that will accept two (or more) of the nested variadic class templates listed below, as arguments, and put them into another data structure that will accept different types (pair or tuple is what I'll most likely use). Here are the classes and subclasses, along with the usage of my function (the fun...
Why can't you pass literal strings in here? I made it work with a very slight workaround.
template<const char* ptr> struct lols {
lols() : i(ptr) {}
std::string i;
};
class file {
public:
static const char arg[];
};
decltype(file::arg) file::arg = __FILE__;
// Getting the right type declaration for this was irritating, so I ...
I have been implementing a visual debugger in my application using another bit of source code. I ran into an issue when I stumbled across them using this..
struct DebugVertex
{
gkVector3 v;
unsigned int color;
};
typedef utArray<DebugVertex> Buffer;
I found the free library that they are using for utArray, however I like to ...
Which is preferred, method 1 or method 2?
Method 1:
LRESULT CALLBACK wpMainWindow(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
{
case WM_PAINT:
{
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
GetClientRect(hwnd, &rc);
hdc = BeginPa...
I am maintaining a VS2010 project which has a number of cross-referenced COM libraries. I am trying to configure the project in such a way that it is buildable from a random workstation which has VS2010 installed. The workstation could be both 32 and 64 bit, so if I configure project to "register output", the build will fail to build on ...
I'm trying to run a command from a window project using system() call but everytime the console shows up. how can i run the command without displaying a console window?
...
My application need to save event viewer logs to a specified directory and it has to be done with win api. Application and System logs are required.
EDIT: EvtExportLog - I found out that I can't use this function because minimal requirements are Win Server 2008, and I need this to work on Win Server 2000 and Win Server 2003.
Any sugges...
The template and cppIntegration examples in the CUDA SDK (version 3.1) use Externs to link function calls from the host code to the device code.
However, Tom's comment at http://stackoverflow.com/questions/2090974/how-to-separate-cuda-code-into-multiple-files#comment-2024913 indicates that the usage of extern is deprecated.
If this the...
i need to create edit box in c++ without using mfc.....
only win32
...
Hey all,
I have a function, which I'd like to get under test. However, it's very large and creates a finite state machine. The function looks roughly like:
std::auto_ptr<IFiniteStateMachine> CreateFSM()
{
std::auto_ptr<IFiniteStateMachine> = apFSM( new CFiniteStateMachine() );
std::list<IState*> listStates;
listState.pus...
For a project I'm currently working on, I'm looking to embed a scripting engine into my C++ code to allow for some extensibility down the line. The application will require a fair amount of text processing and the use of regular expressions within these scripts.
I know Lua is generally the industry darling when it comes to embedded scr...
I found those two terms in the book of Meyers, but what is the difference, thanks in advance for any help
...
I am trying to dissect a legacy application through debugging, but I can't get the breakpoint to hit in certain places of the application. The application has a c# GUI frontend and a c++ backend.
I am trying to put a breakpoint in a c++ project of the solution. There are a couple of c++ projects, but I cannot set a breakpoint in one of...
Hello,
i am developing an application using opencv that manages a set of jpg images (user specifies the folder) and generates a video chronoconically based on EXIF date.
my application must fullfilth the condition:
1) allow any fps value passed by user as parameter (any value between 1 and 100).
at the moment i choosed the CV_FOURCC('...
Hello!
Does C++ offer a way to 'show' something visual if an unhandled exception occurs?
What I want to do is to make something like assert(unhandled exception.msg()) if it actually happens (like in the following sample):
void foo() {
throw std::exception("Message!");
}
int main() {
foo();
}
I expect this kind of code not to te...
Is it better to use POSIX message queues or Unix domain sockets for local IPC communication?
I have worked with Unix sockets between machines (not domain) and I remember that making and breaking the connection would cause sockets to linger awhile before they finally went away. Moreover, if you wanted a "reliable" exchange you either had...