Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+2
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #4K
~1K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Xorlium

Hello! I'm writing some mathematical iterators over some big classes that I don't want to store in memory at all, but I still want to be able to iterate through them. As an example (but I have a few of these), think of a class `Combinations({0,1,2...7}, 3)`, which means I …

Member Avatar for Xorlium
1
312
Member Avatar for Xorlium

Hello, I'm having some problems with inheritance. The following code compiles and runs as expected: It prints out Hey: 1, since SomeFunction returns true. #include <iostream> class Base { public: virtual bool SomeFunction(const int& A) const = 0; }; class Derived : public Base { public: void hey() const; //bool …

Member Avatar for mike_2000_17
0
197
Member Avatar for Xorlium

Hello, I'm still learning C++, and I have a question that I'm not even sure how to search for it, so sorry if this is a repeat. The thing is that I'm trying to make, for a project a-for lack of a better word-memory manager. I want to have kind …

Member Avatar for mike_2000_17
0
198
Member Avatar for Xorlium

Hi, If I have a std::vector of objects and I need to iterate through all its elements, is it faster to do: [code] for (vector::iterator i = myvec.begin(); i != myvec.end(); ++i) //blah [/code] or [code] for (int i = 0; i < myvec.size(); ++i) // myvec[i] blah [/code] Or …

Member Avatar for mrnutty
0
215
Member Avatar for aaronmk2

I am trying to learn about recursives and found this code on the internet. It works, but am not sure why. Could some one explain to me why this works. I have posted comments by the function to explain what I do not understand. [CODE] #include <iostream> using namespace std; …

Member Avatar for aaronmk2
0
101
Member Avatar for Xorlium

Hello! Suppose I'm using an external API, and in that API, they define: const Bar& Foo() const; So this function returns a Bar by reference. Now, I have a function void f() { Bar P = Foo(); } Is it safe to const_cast whatever is returned by Foo? I want …

Member Avatar for Xorlium
0
167