简体   繁体   中英

Meaning of nat in boost c++ library source

In certain portions of boost c++ libraries you read things like:

template<>
struct add_reference<void>
{
  typedef const nat &type;
};

OR

struct nat {int for_bool;};

Is nat a acronym (Not a Type)? If not what is its significance?

I saw this nat in type_traits.hpp and it seems that it's Not a Type; in fact, it acts like a specialization of template<class T> struct add_reference<T&> for the void case; it seems to represent a reference to void and it's probably there for completeness of the implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM