www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - associative_selector_iterator

reply Manfred Ehrhart <ehrhart.dev.nospam free.fr> writes:
Hi,
Currently I use v.1.9.44 but the following problem is the same with the
1.9.60 version.
I have not successfully used the associative_selector_iterator (GCC 4.x),
compilation error.

I realize that the associative_selector_iterator declare a typedef with a
distance_type for the I template parameter. But libstdc++ iterator does not
exhibit such a typedef (accordingly with the
stlsoft/util/std/iterator_helpers file). So evidently, my code does not
compile. I replace it with a typedef I::difference_type distance_type in
the associative_selector_iterator.hpp in order to compile (nevertheless
this typedef is not used)

But finally, I also realize that associative_selective_iterator cannot
compile if the second type is a pointer. In the select_second struct, the
typedef value_type& reference_type cannot compile (reference to pointer). I
think something like boost::call_traits allow to deal with
reference/pointer trick.

Does it exist a workaround, or perhaps I do not correctly use the
associative_selector_iterator.

Thanks you.
Manfred
Nov 05 2008
next sibling parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
Hi Manfred

I should get chance to check out this problem tomorrow. Can you provide a
sample of code that illustrates what you want it to do?
That'd help me a lot

Cheers

Matt

"Manfred Ehrhart" <ehrhart.dev.nospam free.fr> wrote in message
news:geru0l$1qio$1 digitalmars.com...
 Hi,
 Currently I use v.1.9.44 but the following problem is the same with the
 1.9.60 version.
 I have not successfully used the associative_selector_iterator (GCC 4.x),
 compilation error.

 I realize that the associative_selector_iterator declare a typedef with a
 distance_type for the I template parameter. But libstdc++ iterator does not
 exhibit such a typedef (accordingly with the
 stlsoft/util/std/iterator_helpers file). So evidently, my code does not
 compile. I replace it with a typedef I::difference_type distance_type in
 the associative_selector_iterator.hpp in order to compile (nevertheless
 this typedef is not used)

 But finally, I also realize that associative_selective_iterator cannot
 compile if the second type is a pointer. In the select_second struct, the
 typedef value_type& reference_type cannot compile (reference to pointer). I
 think something like boost::call_traits allow to deal with
 reference/pointer trick.

 Does it exist a workaround, or perhaps I do not correctly use the
 associative_selector_iterator.

 Thanks you.
 Manfred

Nov 05 2008
prev sibling parent reply Manfred Ehrhart <ehrhart.dev.nospam free.fr> writes:
Manfred Ehrhart wrote:

 Hi,
 Currently I use v.1.9.44 but the following problem is the same with the
 1.9.60 version.
 I have not successfully used the associative_selector_iterator (GCC 4.x),
 compilation error.
 
 I realize that the associative_selector_iterator declare a typedef with a
 distance_type for the I template parameter. But libstdc++ iterator does
 not exhibit such a typedef (accordingly with the
 stlsoft/util/std/iterator_helpers file). So evidently, my code does not
 compile. I replace it with a typedef I::difference_type distance_type in
 the associative_selector_iterator.hpp in order to compile (nevertheless
 this typedef is not used)
 

My mistake, .....
 But finally, I also realize that associative_selective_iterator cannot
 compile if the second type is a pointer. In the select_second struct, the
 typedef value_type& reference_type cannot compile (reference to pointer).
 I think something like boost::call_traits allow to deal with
 reference/pointer trick.
 
 Does it exist a workaround, or perhaps I do not correctly use the
 associative_selector_iterator.

Indeed, I make a big mistake. I used stlsoft::select_second instead of stlsoft::select_const_second. The gcc error message was not as clear as I expected. My apologies. Manfred
Nov 05 2008
parent reply Manfred Ehrhart <ehrhart.dev.nospam free.fr> writes:
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit

Manfred Ehrhart wrote:

 Manfred Ehrhart wrote:
 
 Hi,
 Currently I use v.1.9.44 but the following problem is the same with the
 1.9.60 version.
 I have not successfully used the associative_selector_iterator (GCC 4.x),
 compilation error.
 
 I realize that the associative_selector_iterator declare a typedef with a
 distance_type for the I template parameter. But libstdc++ iterator does
 not exhibit such a typedef (accordingly with the
 stlsoft/util/std/iterator_helpers file). So evidently, my code does not
 compile. I replace it with a typedef I::difference_type distance_type in
 the associative_selector_iterator.hpp in order to compile (nevertheless
 this typedef is not used)
 

My mistake, .....
 But finally, I also realize that associative_selective_iterator cannot
 compile if the second type is a pointer. In the select_second struct, the
 typedef value_type& reference_type cannot compile (reference to pointer).
 I think something like boost::call_traits allow to deal with
 reference/pointer trick.
 
 Does it exist a workaround, or perhaps I do not correctly use the
 associative_selector_iterator.

Indeed, I make a big mistake. I used stlsoft::select_second instead of stlsoft::select_const_second. The gcc error message was not as clear as I expected. My apologies. Manfred

Finally, I think there is a small couple of problem. - the libstdc++ iterator::distance_type does not exist - The select_second cannot be compiled (but the select_second_const is ok) I changed a 1.9.44 based file and I post a snippet of code. Thanks. Manfred
Nov 06 2008
next sibling parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
Thanks Manfred

I'm still working out what to do with these components. I think I'd like to do
a comprehensive fix, and include them in a 1.10 alpha
release, but that's going to take a week or so, as my plate is pretty full at
the moment.

Thanks again

Matt

"Manfred Ehrhart" <ehrhart.dev.nospam free.fr> wrote in message
news:gev3fk$2beg$1 digitalmars.com...
 Manfred Ehrhart wrote:

 Manfred Ehrhart wrote:

 Hi,
 Currently I use v.1.9.44 but the following problem is the same with the
 1.9.60 version.
 I have not successfully used the associative_selector_iterator (GCC 4.x),
 compilation error.

 I realize that the associative_selector_iterator declare a typedef with a
 distance_type for the I template parameter. But libstdc++ iterator does
 not exhibit such a typedef (accordingly with the
 stlsoft/util/std/iterator_helpers file). So evidently, my code does not
 compile. I replace it with a typedef I::difference_type distance_type in
 the associative_selector_iterator.hpp in order to compile (nevertheless
 this typedef is not used)

My mistake, .....
 But finally, I also realize that associative_selective_iterator cannot
 compile if the second type is a pointer. In the select_second struct, the
 typedef value_type& reference_type cannot compile (reference to pointer).
 I think something like boost::call_traits allow to deal with
 reference/pointer trick.

 Does it exist a workaround, or perhaps I do not correctly use the
 associative_selector_iterator.

Indeed, I make a big mistake. I used stlsoft::select_second instead of stlsoft::select_const_second. The gcc error message was not as clear as I expected. My apologies. Manfred

Finally, I think there is a small couple of problem. - the libstdc++ iterator::distance_type does not exist - The select_second cannot be compiled (but the select_second_const is ok) I changed a 1.9.44 based file and I post a snippet of code. Thanks. Manfred

Nov 10 2008
prev sibling parent "Matt Wilson" <matthewwilson acm.org> writes:
Manfred

I must apologise for having taken so long to address this issue. I have now 
incorporated your changes, along with a few other minor mods and the removal 
of explicit from the ctor, and they will appear in the next release, which 
I'm hoping will be this weekend.

I've also incorporated your test program into a new scratch test and the 
existing unit test, both of which will appear in the next alpha release of 
STLSoft 1.10, which I'm again hoping to release this weekend.

With thanks

Matt

"Manfred Ehrhart" <ehrhart.dev.nospam free.fr> wrote in message 
news:gev3fk$2beg$1 digitalmars.com...
 Manfred Ehrhart wrote:

 Manfred Ehrhart wrote:

 Hi,
 Currently I use v.1.9.44 but the following problem is the same with the
 1.9.60 version.
 I have not successfully used the associative_selector_iterator (GCC 
 4.x),
 compilation error.

 I realize that the associative_selector_iterator declare a typedef with 
 a
 distance_type for the I template parameter. But libstdc++ iterator does
 not exhibit such a typedef (accordingly with the
 stlsoft/util/std/iterator_helpers file). So evidently, my code does not
 compile. I replace it with a typedef I::difference_type distance_type in
 the associative_selector_iterator.hpp in order to compile (nevertheless
 this typedef is not used)

My mistake, .....
 But finally, I also realize that associative_selective_iterator cannot
 compile if the second type is a pointer. In the select_second struct, 
 the
 typedef value_type& reference_type cannot compile (reference to 
 pointer).
 I think something like boost::call_traits allow to deal with
 reference/pointer trick.

 Does it exist a workaround, or perhaps I do not correctly use the
 associative_selector_iterator.

Indeed, I make a big mistake. I used stlsoft::select_second instead of stlsoft::select_const_second. The gcc error message was not as clear as I expected. My apologies. Manfred

Finally, I think there is a small couple of problem. - the libstdc++ iterator::distance_type does not exist - The select_second cannot be compiled (but the select_second_const is ok) I changed a 1.9.44 based file and I post a snippet of code. Thanks. Manfred

Jun 17 2010