| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| 55320.cc | ||
| 57465.cc | ||
| 72820.cc | ||
| addressof.cc | ||
| callable.cc | ||
| deduction.cc | ||
| move.cc | ||
| move_target.cc | ||
| non_copyconstructible.cc | ||
| refqual.cc |
To satisfy the CopyConstructible requirement a callable object stored in a std::function must behave the same when copied from a const or non-const source. If copying a non-const object doesn't produce an equivalent copy then the behaviour is undefined. But we can make our std::function more tolerant of such objects by ensuring we always copy from a const lvalue. Additionally use an if constexpr statement in the _M_get_pointer function to avoid unnecessary instantiations in the discarded branch. * include/bits/std_function.h (_Base_manager::_M_get_pointer): Use constexpr if in C++17 mode. (_Base_manager::_M_clone(_Any_data&, const _Any_data&, true_type)): Copy from const object. * testsuite/20_util/function/cons/non_copyconstructible.cc: New. From-SVN: r260080
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| 55320.cc | Loading commit data... | |
| 57465.cc | Loading commit data... | |
| 72820.cc | Loading commit data... | |
| addressof.cc | Loading commit data... | |
| callable.cc | Loading commit data... | |
| deduction.cc | Loading commit data... | |
| move.cc | Loading commit data... | |
| move_target.cc | Loading commit data... | |
| non_copyconstructible.cc | Loading commit data... | |
| refqual.cc | Loading commit data... |