On 6/11/2007 10:45 AM, Gavin Deane wrote:
> On 11 Jun, 09:14, desktop <f...@sss.com> wrote:
>> Alan Johnson wrote:
>>> desktop wrote:
>>>> I the C++ standard page 472 it says that an associative container can
>>>> be constructed like X(i,j,c) where i and j are input iterators to
>>>> elements. But in the implementation there is no constructor that
>>>> matches this requirement, the only constructors are:
>
> <snip part of implementation specific _Rb_tree class>
>
>>>> How does the implementation meet this requirement when the constructor
>>>> is not implemented?
>>> Nowhere in any part of the standard does it mention the class _Rb_tree,
>>> much less that it satisfies the requirements for an associative container.
>>> _Rb_tree is at most an implementation detail of your specific
>>> implementation. There isn't much of a compelling reason to be digging
>>> around through it unless you are observing some specific incorrect
>>> behavior in your implementation.
>> But how is it out of curiosity that the following works:
>>
>> std::vector<int> hh;
>> hh.push_back(1);
>> hh.push_back(2);
>> hh.push_back(3);
>> std::vector<int>::iterator it1 = hh.begin();
>> std::vector<int>::iterator it2 = hh.end();
>> std::set<int> my_set(it1,it2);
>>
>> when there is no matching constructor for (it1,it2) in the above
>> implementation on my system.
>
> There is a matching constructor, you just haven't found it yet. Note
> that this is straying into the off-topic implementation details of
> your particular compiler, but if you want to find the constructor, you
> could try stepping into it with your debugger.
>
What about this constructor:
template <class InputIterator>
set(InputIterator start, InputIterator finish,
const Compare& comp = Compare()
const Allocator& alloc = Allocator());
??
Regards,
Stefan
--
Stefan Naewe stefan dot naewe at atlas-elektronik dot com
Don't top-post
http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please
http://www.expita.com/nomime.html