Description:
Technical discussion of the C++ language. (Moderated)
|
|
|
solution for macro
|
| |
Hi All, I have a following kind of situation. ...int main(){ ...int a,a_b; a = r(b); ...where I need to construct a symbol ab, at the place where code is executed. A g++ -E test.c, however insert a space between a and b. What could be possible solution for this?
|
|
Where can I find documentation about the internals of cout?
|
| |
Hi! I'm writing my own codecvt but can't find out when (or if) cout is calling codecvt.unshift(). I've vacuum cleaned the net and also tried to Google [link] without any result. Is there anyone that knows where to find documentation whether cout is using codecvt.unshift() or if I can leave that method unimplemented in... more »
|
|
Optional in STL?
|
| |
Hi! Is there, or will be, anything equivalent to boost::optional in STL? Thanks, Daniel
|
|
Mix Static and dynamic Polymorphism
|
| |
Hello all, I just tried to mix static and dynamic polymorphism together. I've a vector to store all the elements, and the implementations of elements are slightly different. I used Policy-based design: struct Interface{ virtual void run(void) = 0; virtual void execute(void) = 0; ...struct PolicyA{... more »
|
|
syntax about function template, or not
|
| |
Forgive my ignorance, I ran into this "little" function coming from LLVM source base about so called "enhanced RTTI", still couldn't figure out what does it mean. 1 // Define reference traits in terms of base traits... 2 template<class FromCl> 3 struct isa_impl_cl<FromCl&> { 4 template<class ToCl>... more »
|
|
help on round robin tournament
|
| |
I want to create a round robin tournament. The function receive a list (I've used a deque) and for now just prints to stdout the results (e.g. the round number and the schedule). If I wanted to provide the user a data structure that has all the miningful informations, what do you propose? Here my code (I'm a C++ novice):... more »
|
|
unsorted_set::erase not O(1) when nearly empty
|
| |
unsorted_set::erase should be O(1) complexity in time. It also returns a pointer to the next element in the data structure. For most implementations of a hashtable, this means iterating through all the empty buckets looking for the next element. If the hashtable is empty, this means checking every single bucket. If there's a large number of... more »
|
|
When are data structures copied
|
| |
Hi, In the following code snippet, when the <string, vector> pair is inserted into the map, is it necessary for the contents of the string and vector to be duplicated, or does this just shuffle pointers around? { string s(100, 'x'); vector<int> v(100); map<string, vector<int>> m; m.insert(make_pair(s, v));... more »
|
|
Implicit operators on a class
|
| |
Hey all, So, if I create a class, and give it a constructor, like so: class Thing { public: Thing( int ); ...Then I can do implicit conversions with that class, like so int main() { int i = 10; Thing t = i; ...However, I ran into a case where I have the following class Skeleton { public:... more »
|
|
|