c++ - move-only input and output iterators -


concerning inputiterator/outputiterator-s consistent modify semantics move-only? surely mean newly-created custom iterators, not stl ones.

notes semantic requirements ++i , ++r expressions input , output iterators correspondingly says:

postcondition: copies of previous value of i no longer required either dereferenceable or in domain of ==.

after operation r not required incrementable , copies of previous value of r no longer required dereferenceable or incrementable.

i think safer prohibit possibility have copies of input/output iterators in cases, never heard such advice. bad idea?

input/outputiterators must first satisfy iterator requirement. , requirement say, c++14, [iterator.iterators], p2:

a type x satisfies iterator requirements if:

  • x satisfies copyconstructible, copyassignable, , destructible requirements (17.6.3.1)

so no, cannot move-only.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -