Opened 6 years ago

Closed 6 years ago

#12543 closed Bugs (worksforme)

boost::async compile error for -std=c++03 and c++98

Reported by: evgeny.panasyuk@… Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

Following code results in compile error on GCC and Clang with -std=c++03 or -std=c++98 flags.

#include <boost/thread.hpp>

struct Calc
{
    typedef int result_type;

    result_type operator()() const
    {
        return result_type();
    }
};

int main()
{
    Calc x;
    boost::async(x);
}

LIVE DEMO: coliru.stacked-crooked.com/a/532c22d37e951a28

Change History (8)

comment:1 by viboes, 6 years ago

Have you tried defining BOOST_THREAD_VERSION 4?

comment:2 by viboes, 6 years ago

Owner: changed from Anthony Williams to viboes

comment:3 by viboes, 6 years ago

PING !!!

comment:4 by evgeny.panasyuk@…, 6 years ago

There is no error with this definition (on both GCC and Clang): coliru.stacked-crooked.com/a/a459a8fbce3c009a

comment:5 by viboes, 6 years ago

Thanks for the report.

I don't know what to do. BOOST_THREAD_VERSION 2 contains a lot of limitation that were solved by BOOST_THREAD_VERSION 3 and 4.

comment:6 by evgeny.panasyuk@…, 6 years ago

Perhaps newer BOOST_THREAD_VERSION should be set by default?

in reply to:  6 comment:7 by viboes, 6 years ago

Replying to evgeny.panasyuk@…:

Perhaps newer BOOST_THREAD_VERSION should be set by default?

No. This will introduce breaking changes.

comment:8 by viboes, 6 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.