March 19th, 2013 05:31 AM
Also be aware that sometimes compilers will initialise variables when in 'debug mode' but leave them untouched when in 'release mode'.
January 31st, 2013 09:03 AM
I have a template defined thus...
namespace stdi3
{
template <typename T, const size_t MAX_SIZE>
class fixed_vector
{
private:
January 29th, 2013 04:27 AM
Well, actually, I'd much prefer a system were adding a path or string to a path would add the path separator, unless the string was already prefixed/postfixed with the separators.
If you want to...
January 28th, 2013 11:28 AM
What other languages use is of no concern to me. It's what the 'conventions' are for C++ that matter.
Maybe, maybe not, but STL strings have been around for a long long time and the slight...
January 25th, 2013 10:15 AM
Whilst I agree that, in a couple of instances, there are operators who's meaning in certain contexts have become canonical (and with '+' for strings I don't think it was a particularly great mental...
January 25th, 2013 06:30 AM
But that's my point. When you look at the operator your first thought will be "how would the canonical understanding of this operator apply to this context". It just doesn't work for '/'.
The...
January 25th, 2013 04:04 AM
I don't see that '+' would be a problem in this case.
You are adding a path to a path and a string to a path. This would be surely be accomodated by overloads of the '+' operator.
std::path...
January 25th, 2013 03:53 AM
I don't disagree that there is a logic behind choosing the '/' operator, it's just that you could come up with 'logical' uses for overloaded operators for all sorts of things. I did it in the past...
January 24th, 2013 08:26 AM
I've been reading up on an introduction to the TR2 file system library in Visual Studio 2012.
I can't say I was very impressed by choice of using the '/' operator to concatonate file paths.
It...
January 23rd, 2013 09:09 AM
The template parameter doesn't even have to be a type.
Here's a template with a non-type parameter, with defaults.
template <const size_t SIZE = 1024>
class FixedLengthContainer
{
};
January 23rd, 2013 06:17 AM
It doesn't for me.
This does compile. Are you sure you didn't mean this?
template<typename T = int>
class abc
{
January 15th, 2013 07:30 AM
I'm assuming that you're asking this question to understand legacy C code.
As you are using C++, the equivelent code in your first example would be.
#include <iostream>
#include <string>
...
December 14th, 2012 03:23 AM
When people try to debug linked lists, my advice (along with stepping through with the debugger) is to get pencil and paper out and draw the sequence of node connections you expect to see when a...
December 11th, 2012 03:04 AM
Did you include <string> ?
December 6th, 2012 03:47 AM
Yes, that's the way I'd approach it.
December 6th, 2012 03:34 AM
Would std::array be a happy compromise?
November 28th, 2012 08:36 AM
The motorcycle that you once bought new is now featured in 'Classic Bike'.
November 23rd, 2012 05:27 AM
If you think you can determine the efficiency of a piece of C++ code just 'by looking' then you should maybe read this.
...
November 21st, 2012 06:08 AM
It's to do with this bit.
"the most derived class's ctor needs to directly call the virtual base class's ctor"
Only 'Fred' can do this as it is a 'friend'. It is private to all other derived...
November 21st, 2012 05:08 AM
The key line is in the article.
"Class Fred can access FredBase's ctor, since Fred is a friend of FredBase, but no class derived from Fred can access FredBase's ctor, and therefore no one can...
November 12th, 2012 03:43 AM
I was watching a repeat of "Stargate SG1 - Ark of Truth" last night when I noticed that the source code of the 'Replicators' created by the Asgard computer bore an uncanny resemblance to Javascript....
October 22nd, 2012 06:02 AM
Pity we can't see the original question any more.
It's not considered good etiquette to erase your earlier posts from a thread.
October 17th, 2012 04:19 AM
Not here it doesn't.
BTW the function 'getName' doesn't.
October 17th, 2012 04:10 AM
warning C4700: uninitialized local variable 'third' used
warning C4700: uninitialized local variable 'second' used
warning C4700: uninitialized local variable 'first' used