Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22042

expected primary-expression before ‘)’ token [duplicate]

$
0
0

Why GCC refuses to compile this code, and how to fix it?

template<size_t ch>class ChannelsData{    std::array<int, ch> vals;public:    template<size_t i>    inline int& at()    {        static_assert( i < ch );        return vals[ i ];    }};template<size_t c>inline void something(ChannelsData<c>& dest){    dest.at<0>() = 0;}int main(){    ChannelsData<1> cd;    something( cd );    return 0;}

Viewing all articles
Browse latest Browse all 22042

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>