Namespaces
Variants
Views
Actions

Talk:cpp/named req/SequenceContainer

From cppreference.com

Why is std::array in the list of SequenceContainers? It provides none of the constructors, emplace, insert, erase, clear, or assign functions in the list of Requirements. Vir (talk) 06:26, 19 March 2015 (PDT)

The spec says
  • 23.2.3[sequence.reqmts]/1 "array is provided as a sequence container which provides limited sequence operations"
  • 23.3.1[sequences.general]/1 "The headers <array>, ... define template classes that meet the requirements for sequence containers."
  • 23.3.2.1[array.overview]/3 "An array satisfies some of the requirements of a sequence container"
Just like Container, this page needs notes under the table to specify exceptions made for individual almost-conforming containers. --Cubbi (talk) 07:10, 19 March 2015 (PDT)
So my disagreement is with the spec. std::array adheres to none of the requirements and some of the optional operations.
Without listing the optional operations on this page, though, the mention of std::array is totally confusing, IMHO. Vir (talk) 03:58, 20 March 2015 (PDT)
Indeed. I added those optional operations. --Cubbi (talk) 07:33, 20 March 2015 (PDT)
Very nice, thanks. Vir (talk) 08:19, 20 March 2015 (PDT)