Opened 4 years ago

Closed 4 years ago

#13574 closed Tasks (worksforme)

Unable to compile boost/test for C++17

Reported by: ki.stfu@… Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost Release Branch Severity: Problem
Keywords: Cc:

Description

For example:

clang-linux.compile.c++.without-pth bin.v2/linux.static.x64/boost/bin.v2/libs/test/build/clang-linux-6.0.0/release/link-static/threading-multi/debug.o
In file included from libs/test/src/debug.cpp:16:
In file included from ./boost/test/impl/debug.ipp:53:
./boost/test/utils/algorithm.hpp:118:42: error: no member named 'bind1st' in namespace 'std'
        if( std::find_if( first2, last2, BOOST_TEST_BIND1ST( pred, *first1 ) ) == last2 )
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./boost/test/utils/algorithm.hpp:25:38: note: expanded from macro 'BOOST_TEST_BIND1ST'
#define BOOST_TEST_BIND1ST(F,A) std::bind1st( (F), (A) )

https://github.com/boostorg/test/issues/146

Change History (5)

comment:1 by Raffi Enficiaud, 4 years ago

What are your compilation environment and options? I am currently building for Visual C++ 17 with /latest and it compiles fine.

comment:2 by ki.stfu@…, 4 years ago

std::bind1st (http://en.cppreference.com/w/cpp/utility/functional/bind12) and many other things were removed in C++17. Just use the right compiler which removed them from its own implementation.

comment:3 by Raffi Enficiaud, 4 years ago

I know, and what I am saying is that it should work with C++17 because it is already handled. Would you care indicating me the compiler that you are using, such that I check with boost.config what is wrong?

comment:4 by Raffi Enficiaud, 4 years ago

For the record, this is what we have in Boost.Test:

#ifdef BOOST_NO_CXX98_BINDERS
#define BOOST_TEST_BIND1ST(F,A) std::bind( (F), (A), std::placeholders::_1 )
#else
#define BOOST_TEST_BIND1ST(F,A) std::bind1st( (F), (A) )
#endif

and associated doc

For you BOOST_NO_CXX98_BINDERS should be defined, and it would be useful that you check that. Maybe some include is missing.

comment:5 by Raffi Enficiaud, 4 years ago

Resolution: worksforme
Status: newclosed

Closing as no update and not having enough information for reproducing the issue.

Note: See TracTickets for help on using tickets.