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

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top