Boost logo

Boost Users :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-12-18 06:10:03


"Duane Murphy" <duanemurphy_at_[hidden]> wrote in message
news:20041218011734.1390_at_linux.murphyslogic.com...
|I am changing a code base that previously was using the no longer
| supported array_traits. I use the begin() and end() functions in a lot of
| places with arrays of integers.
|
| I have converted everything to using boost::range::begin() and end().
| However, there is a severe collision. begin() and more importantly end()
| are overloaded for wchar_t. Turns out on Mac OS X, wchar_t is the same as
| an int.

I don't get it. wchar_t should be a distinct type, in particular *different*
from int.
What compiler are you using ?

| This causes end() to look for a null terminator instead of just
| using the array length template function.
|
| Is there a way I can make range::end() work for real array's of int
| rather than wchar_t?

Its crappy, but boost::range_detail::array_end<int>( my_array )
will pick the index based computation.

-Thorsten

-- 
Thorsten Ottosen
----------------------------
Dezide Aps -- Intelligent Customer Support:
www.dezide.com
Aalborg University --- Decision Support Systems:
http://www.cs.aau.dk/index2.php?content=Research/bss
C++ Boost:
www.boost.org
C++ Standard:
http://www.open-std.org/JTC1/SC22/WG21/ 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net