It is currently Mon Apr 24, 2017 12:30 am

All times are UTC - 5 hours




 Page 1 of 1 [ 9 posts ] 
Author Message
 Post subject: VS 2012 - New Features Worth Looking At
PostPosted: Wed Oct 03, 2012 2:31 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
I have not yet downloaded or tried VS 2012, but read an article on it, and some of the usefull things that isn't available in 2010 or earlier. One item is strongly typed enums.

in 2010
enum Colors { RED, GREEN, BLUE };
enum Moods { HAPPY, BLUE };   // Will not compile in Global Name Space


in 2012
enum class Colors { RED, GREEN, BLUE };
enum class Moods { HAPPY, BLUE };  // Compiles in global name space

in order to use BLUE you have to use the scope resolution Colors::BLUE or Moods::BLUE
plus there are other nice features with enum such as forward declarations and specifying their exact size.
// stronly typed enum class declarations
enum class Mood;
void assessMood( Mood m );

// Later On:
enum class Mood { EXCITED, MOODY, BLUE };

// Well Defined Enum Sizes : can use any signed or unsigned integer type. It defaults to int
// but you can use char, unsigned long, etc.
enum class Color : char { RED = 1, GREEN = 2, BLUE = 3 };

// We Can Do Better!
#include <cstdint>
enum class Colors : std::int8_t { RED = 1, GREEN = 2, BLUE = 3 };


I will provide the link below and all material above is from the following link.

http://www.cprogramming.com/c++11/c++11 ... class.html

The second thing I noticed is RVALUE References and class move constructors and assignment operators using move semantics. Much more efficient coding!
I will just provide the link and you can decide after reading it!
http://www.cprogramming.com/c++11/rvalu ... c++11.html

These were really good reads, I might even go an aquire a version for VS2012 for these reasons :)

I hope you enjoy!


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Wed Oct 03, 2012 5:37 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
Well, I tried to download VS2012, but since I am using Windows Vista, The install file doesn't work :((((
I guess this is Microsoft's way of forcing you to pay more money. Since VS2012 isn't compatable with Vista
I am stuck for the time being with VS2010


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Wed Oct 03, 2012 10:17 pm 

Joined: Thu Sep 27, 2007 5:51 pm
Posts: 48
Well, sooner or later you have to upgrade your OS if you want to use new tools.
I use windows 7, and I just installed VS2012 express without any problems.
Are you sure you chose to download for windows DESKTOP and not windows 8?


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Wed Oct 03, 2012 11:05 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
I have windows Vista with SP1, VS2012 isn't supported by Vista only Windows 7 and up


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Thu Oct 04, 2012 8:59 am 

Joined: Thu Sep 27, 2007 5:51 pm
Posts: 48
Ouch. I guess you have to get a newer OS or use another compiler then, if you want to use C++11. Can you use the Windows headers in other compilers than VC++?


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Thu Oct 04, 2012 10:15 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
I'll probably just get a copy of windows 7 ultimate. However, I will NOT get windows 8. I can install w7 on this pc I have 3 partitions on my 1.5gb hard drive. :).


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Thu Oct 04, 2012 12:23 pm 

Joined: Thu Sep 27, 2007 5:51 pm
Posts: 48
I like windows 7, but windows 8 I haven't looked into much. Will only get it if I get a new computer before the version after 8 comes out. :P

And I sure hope you got more than 1.5GB on your computer. O_o


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Thu Oct 04, 2012 3:44 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
Opps, nice catch i meant 1.5TB, however, my first pc in 1992-93 was an Intel 486 with windows 3.11 or OS2 with Dos 6.0. It had a 1 or 2x cd rom, floppy drive and the hard drive was a full 200MB lol with I think 2-4MB ram, and the games in those days most of which installed and ran through DOS you had to setup the interupts, irqs and or (dma) channels for your sound; lol


Offline
 Profile  
 
 Post subject: Re: VS 2012 - New Features Worth Looking At
PostPosted: Thu Oct 04, 2012 10:03 pm 

Joined: Thu Sep 27, 2007 5:51 pm
Posts: 48
Mmmm, I remember my dads laptop back in like 92-94, I used to play some formula-1 game I think, and pac-man. :)

DMA, IRQs e.t.c. I just recently learned about actually, while doing some NES programming. :)


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron