I am writing a perl script to parse a mysql database schema and create C++ classes when necessary. My question is a pretty easy one, but us something I haven't really done before and don't know common practice. Any object of any of classes created will need to have "get" methods to popluate this information. So my questions are twofol...
For data types such as std::set and std::map where lookup occurs in logarithmic time, is the implementation required to maintain the begin and end iterators? Does accessing begin and end imply a lookup that could occur in logarithmic time?
I have always assumed that begin and end always occur in constant time, however I can't find any c...
I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData. The field in the database is a TEXT field. My function is crafted based on MS's example here:
http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx.
I've setup the environment, made the connection, and prepared my statement successfully but when I ...
AFAIK, there isn't a free code coverage tool for C++.
...
I'm regularly running into similar situations :
I have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format.
Microsoft's Visual Studio platform has very nice capabilities to import such COM DLLs and use them in my project (Visual C++'s #import directi...
Specifically, is the following legal C++?
class A{};
void foo(A*);
void bar(const A
int main(void)
{
foo( // 1
bar(A()); // 2
}
It appears to work correctly, but that doesn't mean it's necessarily legal. Is it?
Edit - changed A& to const A&
...
Hi,
Our current application is a single OpenGL EXE containing multiple pages. The EXE is responsible for accessing data sent across the network via UDP. It accumulates the data and stores it in a host of singleton structures. The individual pages within the EXE access the singleton structures to process the data as they see fit.
In ...
Hi everyone,
We are producing a portable code (win+macOs) and we are looking at how to make the code more rubust as it crashes every so often... (overflows or bad initializations usually) :-(
I was reading that Google Chrome uses a process for every tab so if something goes wrong then the program does not crash compleatelly, only that ...
On windows you have a problem you typically never encounter on Unix. That is how to get a thread to sleep for less than one millisecond. On Unix you typically have a number of choices (sleep, usleep and nanosleep) to fit your needs. On windows however there is only Sleep with millisecond granularity. You can however use the select system...
Is it possible to convert floating point exceptions (signals) into C++ exceptions on x86 Linux?
This is for debugging purposes, so nonportability and imperfection is okay (e.g., if it isn't 100% guaranteed that all destructors are called).
...
I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...
...
Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it.
I want to monitor the phone system for logging purposes (so I ...
I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a .NET client and my question is this - is the firing of the event a synchronous or asynchronous call? My concern is that, if synchronous, the application that handles the event coul...
Is there any difference to the following code:
class Foo
{
inline int SomeFunc() { return 42; }
int AnotherFunc() { return 42; }
};
Will both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inline code? I often use the AnotherFunc syntax (accessors for exampl...
Edit:
From another question I provided an answer that has links to a lot of questions/answers about singeltons: More info about singletons here:
So I have read the thread Singletons: good design or a crutch?
And the argument still rages.
I see Singletons as a Design Pattern (good and bad).
The problem with Singleton is not the Patte...
While incremental linking addresses much of the time spent linking, even for very large projects, I find the incremental linker in MSVS to be pretty haphazard. (I'm currently using 2003 atm, would love to hear if 2005/8 addressed any of this.) My list of known triggers include:
changing anything external to the main .exe project will...
I've read (in Nish Sivakumar's book C++/CLI In Action among other places) that you should use the __clrcall decorator on function calls to avoid double-thunking, in cases where you know that the method will never be called from unmanaged code. Nish also says that if the method signature contains any CLR types, then the JIT compiler will ...
I really hate using STL containers because they make the debug version of my code run really slowly. What do other people use instead of STL that has reasonable performance for debug builds?
I'm a game programmer and this has been a problem on many of the projects I've worked on. It's pretty hard to get 60 fps when you use STL container...
How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?
...
Hi, I'm asking for a template trick to detect if a class has a specific member function of a given signature.
The problem is similar to the one cited here
http://www.gotw.ca/gotw/071.htm
but not the same: in the item of Sutter's book he answered to the question that a class C MUST PROVIDE a member function with a particular signature, ...