首页 > 解决方案 > 尝试使用 bitset 时::reference,编译器抛出错误

问题描述

为什么这段代码会导致编译器错误?

template <size_t N>
class A
{
    bitset<N> _bits;
    void foo(bitset<N>::reference* ref) // this does not compile
    {
        //some code
    }
};

N != сonsexpr 在这种情况下吗?

错误:C2061 语法错误:标识符“参考”

标签: c++templates

解决方案


推荐阅读