Difference between size_t and std::size_t

后端 未结 3 1636
鱼传尺愫
鱼传尺愫 2020-12-07 12:36

What are the differences between size_t and std::size_t in terms of where they are declared, when they should be used and any other differentiating

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 13:27

    From C++03 "17.4.3.1.4 Types":

    For each type T from the Standard C library (footnote 169), the types ::T and std::T are reserved to the implementation and, when defined, ::T shall be identical to std::T.

    And footnote 169:

    These types are clock_t, div_t, FILE, fpos_t, lconv, ldiv_t, mbstate_t, ptrdiff_t, sig_atomic_t, size_t, time_t, tm, va_list, wctrans_t, wctype_t, and wint_t.

提交回复
热议问题