Hi, in code like this:
#pragma once
#include "stdafx.h"
#include "Token.h"
//I would like this enum to be inside class Number
enum Number_enm {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE};
class Number : public Token<Number_enm>//and this template parameter to be Number::Number_enm
{
private:
public:
Number(const N...
The situation is as follows: Thread A catches an exception, saves the exception's data somewhere in memory (using GetExceptionInformation in the exception filter), and afterwords Thread B gets that exception information and wants to rethrow it. But the thing is, when thread B rethrows the caught exception, i'm missing the original call s...
I'm tring to use openssl in a gcc program but it isn't working.
g++ server.cpp /usr/lib/libssl.a -o server
gives error, anything with -l option gives error, what should I type on command line to use openssl. The file /usr/lib/libssl.a exists, but still linker error no such funtion MD5() exists occurs.
...
Hello,
do you use any particular site for function reference or you just google the function?
...
Hello I am putting together a tool chain on my windows Box for Cross Platform C++ Development. I plan on using Boost.Build for building and Boost::Test for unit testing. I will be using Mercurial for my VCS because I can just throw the repo on my external HD and then pull it to either my windows or linux partition. The main thing sta...
Theres are couple of places in my code base where the same operation is repeated a very large number of times for a large data set. In some cases it's taking a considerable time to process these.
I believe that using SSE to implement these loops should improve their performance significantly, especially where many operations are carried...
Hi,
My full code is too long, but here is a snippet that will reflect the essence of my problem:
class BPCFGParser {
public:
...
...
class Edge {
...
...
};
class ActiveEquivClass {
...
...
};
class PassiveEquivClass {
...
...
};
struct EqActiveEquivClass {
...
...
};
struc...
I was asked by my friend a virtual function problem.
If a child object call a virtual function, under what condition, this virtual function is actually executed the one in the father's implementation?
...
Hi ::- ). Assume you have two integers, a = 8, b = 2. In C++ a | b is true. I used that behavior to work with collections of flags. For example the flags would be 1, 2, 4, 8 and so on, and any collection of them would be unique. I can't find how to do that in C#, as the | and & operators don't behave like they would in C++. I read docume...
If I have a std::string containing a comma-separated list of numbers, what's the simplest way to parse out the numbers and put them in an integer array?
I don't want to generalise this out into parsing anything else. Just a simple string of comma separated integer numbers such as "1,1,1,1,2,1,1,1,0".
...
I am using Ubuntu + Eclipse and installed boost(not sure correct). I installed Boost using apt-get install libboost*
I tested some simple code, it seems the boost working right.
However, when I try to learn the thread part, the code below does not work.
#include <boost/thread/thread.hpp>
#include <iostream>
using namespace std;
voi...
I wasn't sure what to call this. I'm building a tile based game where the user can click on a tile.
it is a 2d c++ vector of tiles. right now I have an algorithm that positions them like this:
[][][][][][][][][][][]
[][][][][][][][][][][]
[][][][][][][][][][][]
[][][][][][][][][][][]
[][][][][][][][][][][]
[][][][][][][][][][][]
they ...
How do I determine the Ubuntu Linux Library Path? That is, how does the linker know where to got to grab the object files when linking my program?
...
I'm trying to learn overriding operators in C++. But I'm stuck with this:
..\src\application.cpp: In function `int main()':
..\src\application.cpp:29: error: no match for 'operator<<' in 'std::operator<< >&">with _Traits = std::char_traits(&std::cout)), ((const char*)"Poly A: ")) << (&A)->Poly::operator++(0)'
Here's the line ...
Hi everybody. I've been trying to emulate in C# a behavior which I was implementing without any problems in C++. I have a flag collection, which based on powers of 2, and a flag which I need to check if it exists in the collection.
byte flagCollection = 1 | 2 | 4 | 8;
byte flag = 2;
if ((flagCollection & flag) != 0) MessageBox.S...
Is there a way to get a C stream object (a FILE* object) that points at nothing?
I know fopen("/dev/null","w"); would work but I'm wondering if there is a better way.
Preferably that bit buckets the data at a higher level than the posix layer and that is also more portable.
...
BTW: I found the problem: (See my answer below)
When I build my program at home it works fine, but when I use my universities system is crashing on me. When I go at it with GDB I get this:
(gdb) r t.c-
Starting program: /home/shro8822/p5/c- t.c-
*--Code Gen Function: main
*--in function 'main' variable offsets start at 2
Program re...
Hi,
Just wondering why the syntax for virtual functions uses a const before the curly braces, as below:
virtual void print(int chw, int dus) const;
Incidentally, the code doesnt seem to work without the const, which is interesting.. not sure why?
many thanks!
...
I am trying to specialize some utility code on const member functions, but have problems to get a simple test-case to work.
To simplify the work i am utilizing Boost.FunctionTypes and its components<FunctionType> template - a MPL sequence which should contain the tag const_qualified for const member functions.
But using the test-code be...
Using the output of "ipconfig /all" i can get what I need but I want a more reliable technique to get ip of an interface (practically the interface has to be identified by it's name) in case of ipconfig was corrupted or was not available for any reason.
...