Modify

Ticket #8764 (closed Feature Requests: fixed)

Opened 10 months ago

Last modified 8 months ago

Improve traits of Boost.Move

Reported by: apolukhin Owned by: igaztanaga
Milestone: Boost 1.55.0 Component: move
Version: Boost 1.54.0 Severity: Regression
Keywords: Cc:

Description

Since boost 1.54.0 we have the following traits:

has_trivial_move_assign has_trivial_move_constructor is_nothrow_move_assignable is_nothrow_move_constructible

It means that has_nothrow_move trait in boost/move/traits.cpp can be improved.

Attachments

Change History

comment:1 Changed 9 months ago by igaztanaga

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in revision 85182

comment:2 Changed 8 months ago by apolukhin

I'm afraid that the improved trait breaks one of the tests in libs/move/test/move.hpp.

Following assert:

   BOOST_STATIC_ASSERT((boost::has_nothrow_move<copyable>::value == false));

will be failing now. According to C++11 Standard is_nothrow_move_constructible evaluates to true if the following code does not throw:

copyable var(std::move(nonconst_copyable_variable))

Such code does not throw even if the copyable has no move constructor, but has a nothrow copy constructor.

Following solution could be used to fix tests:

   // Attempt to move construct `copyable` type won't throw exceptions in C++03 and C++11 
   BOOST_STATIC_ASSERT((boost::has_nothrow_move<copyable>::value == true));

comment:3 follow-up: ↓ 4 Changed 8 months ago by igaztanaga

I think that would fix the test only for compilers that can deduce it won't throw. I think we should delete that line as we don't know what the compiler will deduce.

comment:4 in reply to: ↑ 3 Changed 8 months ago by apolukhin

Replying to igaztanaga:

I think that would fix the test only for compilers that can deduce it won't throw. I think we should delete that line as we don't know what the compiler will deduce.

I agree. is_nothrow_move_assignable and is_nothrow_move_constructible traits are covered by tests in Boost.TypeTraits?. Test in Boost.Move mainly duplicates those.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.