Welcome, Guest. Please login or register. Did you miss your activation email?

Poll

Do you use C++11 features?

Yes
36 (50%)
No, but I plan to use them in the near future
25 (34.7%)
No, and I am not interested in them
11 (15.3%)

Total Members Voted: 71

Voting closed: March 10, 2012, 01:58:16 pm

Author Topic: Do you use C++11?  (Read 20553 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Do you use C++11?
« on: March 10, 2012, 01:58:16 pm »
Hello,

Please vote only if you program in C++ (not C or other languages).

I am interested if you make use of basic C++11 features that have already been implemented in compilers like VC 2010 or g++ 4.6.

This concerns mainly these language features:
  • RValue references
  • Lambda expressions
  • Type inference (auto, decltype)
  • Static assertions (static_assert)
  • Null pointer literal (nullptr)
And new parts of the standard library, for example:
  • Memory (std::shared_ptr, std::unique_ptr)
  • Functional (std::function, std::bind())
  • Containers (std::array, std::forward_list, std::unordered_set/map)
  • Algorithms (std::copy_if(), std::move(), std::all_of(), ...)
  • String Conversion (std::to_string(), std::stoi(), ...)
  • Tuples (std::tuple)
  • Type Traits
  • Random
  • Regex
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

unranked86

  • Newbie
  • *
  • Posts: 37
    • View Profile
Do you use C++11?
« Reply #1 on: March 10, 2012, 02:51:31 pm »
Yes, I am, and they are quite nice in my opinion :) I use the new pointers and bind(). But I plan to learn the other features as well, but some of them aren't yet implemented in gcc 4.6.

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Do you use C++11?
« Reply #2 on: March 10, 2012, 03:46:50 pm »
Not yet, I haven't studied it very well but I'm very interested on the new pointers and smart pointers.

TheEnigmist

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Do you use C++11?
« Reply #3 on: March 10, 2012, 04:00:33 pm »
No, but i want to learn it :)

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Do you use C++11?
« Reply #4 on: March 10, 2012, 04:35:23 pm »
No, and I intend to stick with C programming. Gives lower level control.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Do you use C++11?
« Reply #5 on: March 10, 2012, 04:38:29 pm »
Quote from: "unranked86"
But I plan to learn the other features as well, but some of them aren't yet implemented in gcc 4.6.
Do you know which ones? On the internet, I only find tables that compare language feature support, not library features...

Quote from: "Tex Killer"
No, and I intend to stick with C programming. Gives lower level control.
If you don't develop in C++, it's clear you don't use C++11. I should have mentioned the poll addresses only C++ programmers ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

unranked86

  • Newbie
  • *
  • Posts: 37
    • View Profile
Do you use C++11?
« Reply #6 on: March 10, 2012, 05:49:22 pm »
Quote from: "Nexus"
Quote from: "unranked86"
But I plan to learn the other features as well, but some of them aren't yet implemented in gcc 4.6.
Do you know which ones? On the internet, I only find tables that compare language feature support, not library features...



This is the closest thing I found...link
And it says:
Quote
This page describes the C++11 support in mainline GCC SVN, not in any particular release.


And this is the latest stable libstdc++ reference. I'm not sure, if I'm helpful :oops:

Mjonir

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Do you use C++11?
« Reply #7 on: March 10, 2012, 08:04:34 pm »
I don't use them, but it's more that I don't know enough about them. I don't think I'll use them in the near future, but I'm not uninterested either. Would anyone have a link to a nice tutorial introducing them? :)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Do you use C++11?
« Reply #8 on: March 10, 2012, 08:28:15 pm »
I've sometimes used boost::shared_ptr, boost::function and boost::bind(), but I don't use C++11 to keep a wider compatibility.
Want to play movies in your SFML application? Check out sfeMovie!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Do you use C++11?
« Reply #9 on: March 10, 2012, 08:35:57 pm »
unranked86, thanks for the links!


Mjonir, I currently don't know of a single tutorial that covers everything. Some sites that might help you:
  • cpp-next.com is a good site to start, for example it contains series about move semantics.
  • The Wikipedia article provides an overview and short explanations to each feature.
  • The GoingNative 2012 conference contains some videos about C++11, although they don't directly explain the single C++11 features.
  • cppreference.com allows you to lookup standard library functionality.
  • Several library features have already been in Boost, where you can find more in-depth documentation.
And for specific functionality you probably need to search, I'm sure there are many tutorials and blog posts.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

unranked86

  • Newbie
  • *
  • Posts: 37
    • View Profile
Do you use C++11?
« Reply #10 on: March 10, 2012, 11:24:07 pm »
Dream in code C++ tutorial forum
There are some C++11 tutorials here. Like Nexus said, there are lots of them on the net.

I just found this It does not seem in-depth, by the way.

thePyro_13

  • Full Member
  • ***
  • Posts: 156
    • View Profile
Do you use C++11?
« Reply #11 on: March 11, 2012, 07:38:42 am »
I'm only using the null pointer literal and the new <memory> templates.

The rest is a bit beyond me so far.

Quote from: "Nexus"
But you voted Yes? ;)
Yes, I did. :p

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Do you use C++11?
« Reply #12 on: March 11, 2012, 09:58:09 am »
Quote from: "thePyro_13"
I'm only using the null pointer literal and the new <memory> templates.
But you voted Yes? ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Do you use C++11?
« Reply #13 on: March 11, 2012, 10:12:29 am »
Yes yes yes :)

Variadic templates are amazingly powerful and the only way to emulate them pre-C++11 is via generating code with scripts (how boost::function was written....a lot of partial specialisations generated by scripts).

static assertions are rather useful.
 Actually having access to a random number generator other than the horrible rand is silly useful.
Rvalues rule.
constexpr rules.
auto is useful for those massive names.
Lambda functions and std::function make everything more flexible.
std::sto... I use but it's hidden behind a templated function that uses a functor to specialise to the correct std::sto, to_string or if all else fails string stream. Kinda like boost::lexical_cast.
Smart pointers..I could go on for awhile actually.
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

Lee R

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Do you use C++11?
« Reply #14 on: March 11, 2012, 11:02:43 am »
Quote from: "MorleyDev"
Variadic templates are amazingly powerful and the only way to emulate them pre-C++11 is via generating code with scripts (how boost::function was written....a lot of partial specialisations generated by scripts).


Not quite. They can be emulated with preprocessor macros (and they are, at least in Boost.Function).