Doubts about the C ++ standards [closed]

3

I have a couple of doubts

  • What is the most commonly used standard now?

  • If I make a program for example in the C ++ 14 standard, will portability and code execution affect it?

asked by Malthael 23.02.2017 в 18:51
source

2 answers

3
  

What is the most commonly used standard now?

It's a complicated answer to answer. In my case the current standard is c ++ 11 but in a few months we will change the compiler and we will use c ++ 14.

Generally speaking, I assume that something similar will happen to the rest. There are several reasons to stay stuck in an old standard:

  • dependence on third-party libraries without maintenance. Not compiling for new compilers forces you to stagnate until you find a replacement.
  • embedded systems. Some embedded systems have compilers with marginal maintenance and this makes them evolve more slowly
  • old systems. New compilers may not be available for old OS MSDOS or Windows 95 type.
  

If I make a program, for example, in the C ++ 14 standard, will portability and code execution affect it?

The C ++ 14 standard introduces some novelties regarding c ++ 11, many with respect to c ++ 03. Using one of these features will prevent you from compiling the code under an older standard.

    
answered by 23.02.2017 / 19:32
source
3

What is the most commonly used standard now?

Cheat question. Not being, far from it, an expert in C ++, nor a professional of the guild, I currently use C ++ 11, mainly due to the great improvements in speed it provides, eliminating many copy operations of instances, which with previous standards were inescapable.

C ++ 11 provides excellent backwards support, so that, with just recompiling, we get an efficiency improvement free .

We can consider it the minimum essential in current projects, and more taking into account that we are in 2017. That standard is already a few years old.

If I make a program for example in the C ++ 14 standard, will portability and code execution affect it?

Another cheating question. The code will compile on any compiler that supports C ++ 14.

If you mean the ease of finding a compiler with support for that standard, g++ is free software, ported to more platforms than I've seen in my life. It should not be a problem, except for very environments .

If you mean auxiliary elements, such as bookstores, that's another topic. As a general rule, if they are maintained, they will support the new standards.

As I mentioned, the backwards compatibility is very good, so most of the old software will not have problems.

    
answered by 23.02.2017 в 19:48