Difference between cstdint and tr1 / cstdint

What is the difference between <cstdint>and <tr1/cstdint>? (besides putting things in the namespace std::and the other in std::tr1::)

Since this material is not standard, but I assume that it is specific to the compiler, so I'm talking about gcc. To compile with non-tr1, I have to compile with -std=c++0x, but when using tr1 there is no such restriction.

Is the answer perhaps not, but you can't get around adding things in std::, if not there, well, standard. So, until C ++ 0x is standardized, the error should be thrown using <cstdint>, but you don’t have to worry about adding to the namespace tr1::that does not pretend to be standard? Or is it still not?

Thank.

ps - If you read "std" as a standard, like me, I apologize for overuse of the word in this Q.

+3
source share
3 answers

, , <cstdint> TR1 ++ 0x. #include ing <cstdint>, , - , , undefined. , .

+3

, . , . , /usr/include/c++/4.4/tr1/cstdint :

#  define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
#  define _GLIBCXX_END_NAMESPACE_TR1 }
#  define _GLIBCXX_TR1 tr1::

/ usr/include/c++/4.4/cstdint :

#  define _GLIBCXX_BEGIN_NAMESPACE_TR1
#  define _GLIBCXX_END_NAMESPACE_TR1
#  define _GLIBCXX_TR1

, <cstdint>, TR1 .

+3

<tr1/cstdint> , , TR1, <cstdint> ++ 0x.

gcc, -std=c++0x , , , ++ 0x. <tr1/cstdint> TR1, ++ 0x, -std=c++0x .

gcc -std=c++0x .

ISO ++ 0x.     , , ,     ++ 0x. ,     , ,     GCC, ++ 0x    .

+2

Source: https://habr.com/ru/post/1752190/


All Articles