1
0
forked from boostorg/mpl

Merged revisions 65167 via svnmerge from

https://svn.boost.org/svn/boost/trunk

........
  r65167 | steven_watanabe | 2010-09-01 09:08:21 -0700 (Wed, 01 Sep 2010) | 1 line
  
  Fix for_each test for C++0x
........


[SVN r66257]
This commit is contained in:
Eric Niebler
2010-10-29 21:36:38 +00:00
parent cad61ebca3
commit 61f3e9cb9a

View File

@@ -55,6 +55,11 @@ struct value_printer
# pragma warning(disable:985) # pragma warning(disable:985)
#endif #endif
void push_back(std::vector<int>* c, int i)
{
c->push_back(i);
}
int main() int main()
{ {
typedef mpl::list<char,short,int,long,float,double> types; typedef mpl::list<char,short,int,long,float,double> types;
@@ -63,16 +68,9 @@ int main()
typedef mpl::range_c<int,0,10> numbers; typedef mpl::range_c<int,0,10> numbers;
std::vector<int> v; std::vector<int> v;
#if defined(__SGI_STL_PORT)
void (std::vector<int>::* push_back)(int const&) = &std::vector<int>::push_back;
mpl::for_each<numbers>( mpl::for_each<numbers>(
boost::bind(push_back, &v, _1) boost::bind(&push_back, &v, _1)
); );
#else
mpl::for_each<numbers>(
boost::bind(&std::vector<int>::push_back, &v, _1)
);
#endif
mpl::for_each< numbers >(value_printer(std::cout)); mpl::for_each< numbers >(value_printer(std::cout));