c++

Doxygen C++ conventions

I'm at the beginning of a C++ project and I've been using Doxygen from the start. I'd like to know how you use Doxygen in your project, i.e. I have several questions: 1. Where do you put your Doxygen comments? Header or sources? I think that they should go to the header, because that's where I look to find out how to use methods. Howe...

Converting c++ project to clr safe project

Hi, I need to work on converting a very huge c++ project to clr safe. The current c++ project has a lot of stuff from c++ like templates, generics, pointers, storage/stream, ole apis, zlib compression apis, inlines etc. Where can I find the datiled document for this type of conversion? Can you suggest some good book to refer to? If anyo...

chart library for QT

Hello, Is there any opensource or free chart library for Qt ? I mean XY charts (not bar charts or sth like that) ? thanks for help ...

Why it's valid to include a header file twice in c++?

#include "DLLDefines.h" #include "DLLDefines.h" The above actually passed compilation, but why? ...

Maybe (... yeah right) solved: Double checked locking on C++: new to a temp pointer, then assign it to instance.

Hi all, This is a follow up of this post on double checked locking. I am writing a new post because it seems that posting a follow-up on "aged" posts doesn't make it as visible/active as sending out a new post, maybe because most people do not sort posts in stackoverflow by level of activity. To all who responded, thank you for all you...

for each in GCC and GCC version

hi how can I use for each loop in GCC? and how can i get GCC version? (in code) ...

Calculating Binomial Coefficient (nCk) for large n & k

Hi everyone! I just saw this question and have no idea how to solve it. can you please provide me with algorithms , C++ codes or ideas? This is a very simple problem. Given the value of N and K, you need to tell us the value of the binomial coefficient C(N,K). You may rest assured that K <= N and the maximum value of N is 1,000,000,...

C++ - building static library question

Hello! I built libbz2 (static variant) using MinGW (GCC 4.5.0) compilation system and now try to import this library into my MSVS2008 project. I've done these things already and everything worked fine, for example, with zlib (which means that created C libraries are actually interchangeable). However, when doing the same with libbz2, ...

VIM open compile error in existing or new tab

When I compile or run a file from VIM all error references are opened in the last active buffer regardless if the file is open already in another vim tab. This behavior is very annoying. Is there any way to force vim to behave like ':tab drop' on compile errors? (See http://vim.wikia.com/wiki/Edit_a_file_or_jump_to_it_if_already_open) ...

The application failed to initialize properly (0xc0150002)

I'm trying to compile an SFML program I've writting in Visual C++ 2010. It compiles fine, but when I run the executable I get this error: The application failed to initialize properly (0xc0150002). Click on OK to terminate the application. This happens every time I try to run an application that uses SFML, I have included the librari...

LNK1561 Linking Error in MSVS2010 when main is defined

I have been making several projects to compile small SDL code tutorials from a tutorial site in Microsoft Visual Studio 2010 using C++>Empty Projects; and all of these projects have compiled fine. In all of these projects I've used this version of main for my entry point: int main (int argc, char* args[]) { //code... return 0; }...

What is _tmain at all?

Possible Duplicate: What is the difference between _tmain() and main() in C++? I found it in this post, but never see that before. ...

A doxygen eclipse plugIn with automatic code completion?

I'am looking for an eclipse-plugin for doxygen code documentation. I have found the eclox-plugIn ( http://home.gna.org/eclox/ ). I would like find out, how can it automatically generate a "empty" doxygen comment, which could be filled out later or what is the better choice for a documentation eclipse plugIn? For example for a function: ...

create map using two array

i am trying to create map using two array here is code #include <algorithm> #include <iostream> #include <map> #include <utility> #include <iterator> #include <string> using namespace std; using std::transform; int main(){ const char* word[]={"A","B","C","D","E"}; const char * clue[]={"a","b","c","d","e"}; map<string,strin...

Boost.Fusion Functional: Calling functions with default arguments

Is it possible to use boost::fusion::invoke function to call a function that has default arguments without specifying those? Example: void foo(int x, int y = 1, int z = 2) { std::cout << "The sum is: " << (x + y + z) << std::endl; } ... // This should call foo(0). It doesn't work because the type of foo is void (*) (int, int, int)....

Which language/framework for HPC: Java/.Net/Delphi/C/C++/Objective-C?

I have deliberated endlessly over which language/framework best suits the following. I need to develop a HPC framework. All processing will be completely OO. It will pass objects between instances (external) and internally between threads & engines. The Objects will be an extension of Active Messages. These instances could run on mobile...

Fastest type for std::map key?

I would like to use the partitions of a graph as the key to a std::map I could represent this as a std vector of nodes. Or I could convert it into a more compact 'custom' binary format (bitset?), or a string representation. For simplicitiy's sake, we can say there is no inherent order to partitions of a graph. Which will be fastest i...

Is there an alternative to using static_cast<int> all the time?

Hi, I have an enumeration called StackID, and throughout my code I have to static_cast it to int quite a bit - e.g. StackID somestack; int id = static_cast<int>(somestack); Is there a shorthand alternative to doing this cast over and over again ? I have heard of "implicit" conversions - is that something I can use here? (Possibly re...

Nested classes: Access to protected member of enclosing class from a nested protected class

This code compiles on msvc/g++: class A{ protected: int i; class B{ public: A* a; B(A* a_) :a(a_){ } void doSomething(){ if (a) a->i = 0;//<---- this part } }; public: A() :i(0){ } }; As you can see, B gets access to "protect...

Help understanding this?

I have this algorithm that I found here, just one thing puzzles me about it: Clear the stencil buffer to 1. Pick an arbitrary vertex v0, probably somewhere near the polygon to reduce floating-point errors. For each vertex v[i] of the polygon in clockwise order: let s be the segment v[i]->v[i+1] (where i+1 will wrap t...