Boost logo

Boost :

Subject: [boost] [range] missing include in for_each.hpp
From: Eric Niebler (eric_at_[hidden])
Date: 2012-06-29 15:39:30


On 6/29/2012 12:15 PM, Sergiu Dotenco wrote:
> The problem seems to be in
> boost/range/algorithm/for_each.hpp. If I try to compile the following
> snippet using VC10,
>
> #include <boost/range/algorithm/for_each.hpp>
>
> void foo(int)
> {
> }
>
> int main()
> {
> int a[] = { 1, 2, 3 };
> boost::for_each(a, foo);
> }
>
> the compiler outputs
>
> boost_1_50_0\boost\range\algorithm\for_each.hpp(34): error C2143: syntax
> error : missing ',' before '<'
> boost_1_50_0\boost\range\algorithm\for_each.hpp(34): error C4430:
> missing type specifier - int assumed. Note: C++ does not support default-int
> boost_1_50_0\boost\range\algorithm\for_each.hpp(52): error C2143: syntax
> error : missing ',' before '<'
> boost_1_50_0\boost\range\algorithm\for_each.hpp(52): error C4430:
> missing type specifier - int assumed. Note: C++ does not support default-int
> boost_1_50_0\boost\range\algorithm\for_each.hpp(58): error C2995:
> 'UnaryFunction
> boost::range::for_each_detail::for_each_impl(Iterator,Iterator,UnaryFunction,int)'
> : function template has already been defined
> boost_1_50_0\boost\range\algorithm\for_each.hpp(33) : see declaration of
> 'boost::range::for_each_detail::for_each_impl'
>
> due to the missing
>
> #include <boost/utility/enable_if.hpp>
>
> in boost/range/algorithm/for_each.hpp.

Thanks. Please file a bug against the Boost.Range library. Seems like a
trivial fix.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk