|
-
December 31st, 2008, 01:49 PM
#1
msvc9 express copy/paste issue
Code:
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include<algorithm>
#include<ctime>
#include<cstdlib>
#include<cstdio>
#include"typedefs.h"
namespace GT
{
template < uint N >
class Sequence
{
private:
IntVec sequence_;
Sequence( const Sequence& );
Sequence& operator =( const Sequence& );
public:
Sequence()
{
sequence_.reserve( N );
for ( int i = 1; i <= N; ++i )
{
sequence_.push_back( i );
}
Shuffle();
}
const IntVec& GetSequence() const
{
return sequence_;
}
staticvoid Randomize( uint def = 0 )
{
if ( def == 0 )
def = static_cast<uint>( std::time( NULL ) );
std::srand( def );
}
void Shuffle()
{
std::random_shuffle( sequence_.begin(), sequence_.end() );
}
};
} // end namespace
#endif// header guard
The above was pasted from msvc9 express. As you can see this destroys all indentation and even sometimes joins keywords together losing the space between them. What can i do? Others who use msvc9 dont seem to have this problem. I have already told it to use spaces rather than tabs as in all previous versions of msvc I have used. The syntax colouring is nice, but not at the expanse of destroying structure!
Anyone know the fix for this issue??
Also it appears this text is green as the last line of code is a comment. Very strange behaviour.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|