boost + stlport : Failed to specialize function template

Hello! I'm trying to compile following code (msvc8 + boost1.36.0 + stlport5.1.7) #include <boost/range/size.hpp> #include <iostream> #include <vector> template< class InputRng, class T > inline T accumulate( const InputRng& r, T init ) { return std::accumulate( boost::begin(r), boost::end(r), init ); } template <typename Range> typename boost::range_iterator<Range>::type::value_type mean(const Range &range, typename boost::range_iterator<Range>::type::value_type init= #ifndef BOOST_MSVC typename #endif boost::range_iterator<Range>::type::value_type()) { return typename boost::range_iterator<Range>::type::value_type( boost::accumulate(range, init)/boost::size(range)); } int main(){ std::cout << "test" << std::endl; std::vector<double> data; data.push_back(1); data.push_back(2); data.push_back(3); double m = mean(data); std::cout << m << std::endl; return 0; } It keeps giving me: error C2893: Failed to specialize function template 'boost::range_iterator<C>::type::value_type mean(const Range &,boost::range_iterator<C>::type::value_type)' ..\my works\misc\mean_range_test\testapp.cpp 35 BUT, if I remove the dependency to the STLport (and use MSVC's STL), it works fine! Unfortunately, I need this STLport to work on. I really appreciate for any helps. Thank you! Best, Dio -- View this message in context: http://www.nabble.com/boost-%2B-stlport-%3A-Failed-to-specialize-function-te... Sent from the Boost - Users mailing list archive at Nabble.com.

On Wed, Oct 29, 2008 at 7:33 PM, gatotkaca <dio_chernobyl@yahoo.com> wrote:
Hello!
I'm trying to compile following code (msvc8 + boost1.36.0 + stlport5.1.7)
template <typename Range> typename boost::range_iterator<Range>::type::value_type
That (and other occurrences) should be: typename boost::range_value<Range>::type and you need #include <boost/range/value_type.hpp> ;-) Best, Stjepan
participants (2)
-
gatotkaca
-
Stjepan Rajko