Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

std::array error: Has no member named 'assign'

In the following code, the compiler complains as: struct std::array<double,5ul> has no member named 'assign'. Here, it seems possible. Why is it so? (Compiler: g++ 4.8.2)

#include <array>

int main()
{
    std::array<double,5> arr;
    arr.assign(4.); // error: has no member named 'assign'
    return 0;
}
like image 834
Shibli Avatar asked Nov 27 '22 09:11

Shibli


1 Answers

array::assign() is a Visual Studio extension. You are compiling with g++. Check here standard g++ array

like image 84
Tio Pepe Avatar answered Dec 25 '22 09:12

Tio Pepe