
On 12/6/2010 12:56 PM, Mateusz Loskot wrote:
I am not sure about it. IMO, the situation is is similar to standard algorithms and predicates: if a semantic is not specified in details, any valid semantic is possible in terms of presented function prototype/class definition, etc.
Reading about std::remove_if in copy of the n3092, I don't see a word about specific move/copy requirements of predicate, however, the algorithm is free to make number of copies of the predicate internally.
Back to the Boost.IOStreams, indeed, the docs are incomplete [1] but as the the author explained on the list, the devices (Source is a device) does not have to follow "must be copy-constructibile" but they "can be non-copyable", what means that some may be copyable as well.
[1] http://lists.boost.org/Archives/boost/2005/11/96479.php [2] http://lists.boost.org/Archives/boost/2005/10/95939.php
Best regards,
Yes, implementations of a spec are free to implement their requirements however they like (assuming no other requirements are violated). That being said, I just looked at the implementation of array_source and it appears that none of the data in the array is being copied.