您当前的位置: 首页 >  ar

令狐掌门

暂无认证

  • 0浏览

    0关注

    513博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C++ boost库教程(七):boost数组array

令狐掌门 发布时间:2019-05-19 01:02:07 ,浏览量:0

boost数组array

boost有自己的数组,性能比普通数组差一点,使用时包含头文件

#include 

boost::array的部分源码如下

    template
    class array {
      public:
        T elems[N];    // fixed-size array of elements of type T
​
      public:
        // type definitions
        typedef T              value_type;
        typedef T*             iterator;
        typedef const T*       const_iterator;
        typedef T&             reference;
        typedef const T&       const_reference;
        typedef std::size_t    size_type;
        typedef std::ptrdiff_t difference_type;
​
        // iterator support
        iterator        begin()       { return elems; }
        const_iterator  begin() const { return elems; }
        const_iterator cbegin() const { return elems; }
        
        。。。
    };

boost和std都

关注
打赏
1652240117
查看更多评论
立即登录/注册

微信扫码登录

0.0666s