Type: Posts; User: monarch_dodra
Search took 0.07 seconds.
Yeah, the take home point here is that "" is a bad idea. "(x, y)" (or "get(x ,y)" if you don't like operator()) is the way to go.
An argument in favour of "" is that it could return an...
February 21st, 2015, 03:05 PM
If your error is "Error 127 - Process not found", the it is not a C++ problem, but an environment/program problem. There is absolutely nothing wrong with your program, which should work as-is....
February 20th, 2015, 10:19 AM
Actually, we should now prefer uniform initialization, and possibly, the "almost always auto" anitialization.
February 13th, 2015, 10:42 AM
Yes, it did not disprove the UB. It did disprove the "If you do it anyways, it terminates". Which was kind of my point that both statements are contradictory (you can't have UB if the standard...
February 13th, 2015, 08:41 AM
Wait what? since when? That's news to me. Are you sure about this? AFAIK, you just *shouldn't* throw exceptions in destructors. Do you have any references for that?
If you do it anyway, and it...
February 9th, 2015, 04:41 AM
Agreed. But when all that is said and done, dynamic_cast is usually frowned upon and a good sign of code smell. As for private inheritance, while I understand the concept and use-case, I have NEVER...
February 6th, 2015, 05:30 PM
It doesn't really "work". It just appears to work. The cast is illegal, and you are in undefined behavior.
The reason you *think* it works is because dif was *not* declared virtual, and as such...
February 6th, 2015, 06:21 AM
I'm not sure what you mean by "recursively incomplete". The issue is rather that you will have multiple definition issues (since you are redefining it on a "per template instance" basis). As (kinda)...
February 4th, 2015, 10:22 AM
This thread is so ridiculously off topic (and against TOS), that I don't know why any of us are still replying. Not only that, the actual question itself is vague beyond the possibility of any...
January 30th, 2015, 10:37 AM
My first google result for "mime case sensitive" (http://stackoverflow.com/questions/12869278/are-mimetypes-lowercase-case-insensitive) seems to indicate that RFC 2045 states that (quoting quote from...
January 23rd, 2015, 12:17 PM
Be careful. This is probably not what you wanted. I believe what you wanted here was to do a "specialization"? This is not what you did. What you did was declare a template parameterized on *a*...
January 16th, 2015, 04:26 PM
Actually, that's a good point. I forgot about that. That means that my_map.end() is always valid *for a given map*, regardless of what you do to that map.
I would also guess that that kind of also...
January 16th, 2015, 11:39 AM
Sounds like a good plan actually :)
January 16th, 2015, 10:20 AM
Hum... I'd have suggested "optns.end()" instead... ?
Although if you do modify optns, then later, your piter might not compare with .end()
I'd have suggested simply "OPTITER()", but depending...
January 10th, 2015, 03:11 AM
I'm pretty sure there is also a big implication on compilation times...
January 5th, 2015, 09:38 AM
Generate 3 random numbers between 0 and 191, and flip those bits?
Just make sure you don't generate the same number twice: Either re-roll when it happens, or try a random shuffle.
January 5th, 2015, 09:32 AM
To add to that, I'd add an abstract class called "Player", which would have different implementations, such as "HumanPlayer" "DumbAI" "SmartAI" etc...
A Game would be made of 2 Players and a...
December 18th, 2014, 04:49 AM
My first comment is: "I know it's easier using std::list but we were asked to implement the projet using our own home-made List class, so we learn how to do it." I don't see a home made list class...
December 17th, 2014, 10:00 AM
Should your nodes hold the number information in some place? Or is the idea that the node's index in its container makes that implicit?
In any case, to insert a word, I'd decompose it into its...
December 17th, 2014, 08:37 AM
Ideally, I think you should store your names in an (unordered_)set. A set is a data structure that manages its own ordering, and is itself capable of retrieving items for you, and knowing if they are...
December 17th, 2014, 06:42 AM
You need to read what you just wrote. Which variable are you using to iterate?
December 17th, 2014, 06:14 AM
Please properly format your code. I don't see any "search name" function. What exactly isn't working for you?
This declares a variable length array and is not standard C++. Use an std::vector...
December 16th, 2014, 04:06 AM
I remember this question with the actual "design requirements" which would have better helped answer. As is, we can only guess from the names what the functions should do. My guess is:
December 14th, 2014, 05:23 AM
There is a version of find called "find_if" that can take a predicate, and will return an iterator to the first element for which pred(e) returns true.
If you do a functor approach (with state!),...
December 12th, 2014, 10:13 AM
BTW, month names in English are capitalized.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.