Opened 9 years ago

Closed 9 years ago

#9366 closed Bugs (fixed)

async(Executor, ...) fails to compile with msvc-10,11,12

Reported by: viboes Owned by: viboes
Milestone: Boost 1.56.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

The following code

#ifdef BOOST_THREAD_PROVIDES_EXECUTORS
  {
    try
    {
      boost::executor_adaptor<boost::thread_pool> ex(1);
      boost::future<int> f = boost::async(ex, &f0); // [HERE]
      boost::this_thread::sleep_for(ms(300));
      Clock::time_point t0 = Clock::now();
      BOOST_TEST(f.get() == 3);
      Clock::time_point t1 = Clock::now();
      BOOST_TEST(t1 - t0 < ms(300));
      std::cout << __FILE__ << "[" << __LINE__ << "] " << (t1 - t0).count() << std::endl;
    }
    catch (std::exception& ex)
    {
      std::cout << __FILE__ << "[" << __LINE__ << "]" << ex.what() << std::endl;
      BOOST_TEST(false && "exception thrown");
    }
    catch (...)
    {
      BOOST_TEST(false && "exception thrown");
    }
  }
#endif

generates this compile error in line [HERE].

Test output: teeks99-10-win2008-64on64 - thread - async__async_p / msvc-12.0
Rev 86614 / Mon, 11 Nov 2013 02:28:09 +0000
Compile [2013-11-11 13:03:02 UTC]: fail



    call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64 >nul
cl /Zm800 -nologo @"C:\local\results\boost\bin.v2\libs\thread\test\async__async_p.test\msvc-12.0\debug\address-model-64\threading-multi\sync\futures\async\async_pass.obj.rsp" 

async_pass.cpp
C:\local\boost\boost/thread/executor.hpp(230) : warning C4520: 'boost::executor_adaptor<boost::thread_pool>' : multiple default constructors specified
        ..\libs\thread\test\sync\futures\async\async_pass.cpp(224) : see reference to class template instantiation 'boost::executor_adaptor<boost::thread_pool>' being compiled
C:\local\boost\boost/exception/exception.hpp(451) : error C2280: 'boost::detail::async_func<int (__cdecl *)(void),>::async_func(const boost::detail::async_func<int (__cdecl *)(void),> &)' : attempting to reference a deleted function
        C:\local\boost\boost/thread/detail/async_func.hpp(49) : see declaration of 'boost::detail::async_func<int (__cdecl *)(void),>::async_func'
        This diagnostic occurred in the compiler generated function 'boost::detail::shared_state_nullary_task<Rp,Fp>::shared_state_nullary_task(const boost::detail::shared_state_nullary_task<Rp,Fp> &)'
        with
        [
            Rp=Rp
,            Fp=boost::detail::async_func<int (__cdecl *)(void),>
        ]
            


Change History (4)

comment:1 by viboes, 9 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:2 by viboes, 9 years ago

Changeset [86744] seems to fix the trunk errors.

comment:3 by viboes, 9 years ago

Milestone: To Be DeterminedBoost 1.56.0

comment:4 by viboes, 9 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.