简体   繁体   English

boost在c ++库源代码中的含义

[英]Meaning of nat in boost c++ library source

In certain portions of boost c++ libraries you read things like: 在boost c ++库的某些部分,您可以阅读以下内容:

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

OR 要么

struct nat {int for_bool;};

Is nat a acronym (Not a Type)? nat是首字母缩写词(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; 我在type_traits.hpp中看到了这个nat,看起来它不是一个类型; in fact, it acts like a specialization of template<class T> struct add_reference<T&> for the void case; 实际上,它就像void case的template<class T> struct add_reference<T&>的特化一样; it seems to represent a reference to void and it's probably there for completeness of the implementation. 它似乎代表了对void的引用,它可能存在于实现的完整性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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