Does std::array have an assign member function?

A

Anand Hariharan

Visual Studio provides an 'assign' member function for std::array<> (cf.
http://msdn.microsoft.com/en-us/library/bb982277.aspx), but g++ 4.8.2
does not.

Does the standard require it? It seems that 23.2.3 requires it, but
23.3.2 does not mention it.

NB: IANAL and I am a mere mortal, so my reading skills fall far short of
what one needs to read a document like the C++ standard.

thank you for listening,
- Anand
 
V

Victor Bazarov

Visual Studio provides an 'assign' member function for std::array<> (cf.
http://msdn.microsoft.com/en-us/library/bb982277.aspx), but g++ 4.8.2
does not.

Does the standard require it?

From what I can see, no.
It seems that 23.2.3 requires it, but
23.3.2 does not mention it.

There is an excuse in the text that likely allows 'array' /not/ to
provide 'assign'. The 'array' template provides "limited sequence
operations". The operation 'assign' requires the container to be
resizable, which 'array' isn't.
NB: IANAL and I am a mere mortal, so my reading skills fall far short of
what one needs to read a document like the C++ standard.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top