[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-bugs
Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11229: vector incorrectly copies move-only objects using mem
From: "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date: 2015-04-28 21:28:58
Message-ID: 072.fccef17181132d8ad150620cc515a81a () lists ! boost ! org
[Download RAW message or body]
#11229: vector incorrectly copies move-only objects using memcpy
-------------------------------+------------------------
Reporter: joseph.thomson@… | Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: move
Version: Boost 1.58.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------
Comment (by joseph.thomson@…):
Sorry, I incorrectly assumed that trunk would contain the latest version
of the source code (I was using 1.57.0, tested 1.58.0 briefly, and then
looked to fix the change in trunk).
I have just tested your update, and it seems conceptually fine. However,
it fails to compile on MSVC because `yes_type` and `no_type` are
undefined. Copy-paste error I think. Here is the test program I used:
{{{
#include <boost/container/vector.hpp>
#include <iostream>
#include <memory>
int main() {
auto deleter = [](int*) {
std::cout << "delete\n";
};
using T = std::unique_ptr<int, decltype(deleter)>;
std::cout << std::boolalpha;
std::cout << "is_copy_constructible: " <<
boost::move_detail::is_copy_constructible<T>::value << "\n";
std::cout << "is_copy_assignable: " <<
boost::move_detail::is_copy_assignable<T>::value << "\n";
std::cout << "is_trivially_copy_constructible: " <<
boost::move_detail::is_trivially_copy_constructible<T>::value << "\n";
std::cout << "is_trivially_copy_assignable: " <<
boost::move_detail::is_trivially_copy_assignable<T>::value << "\n";
boost::container::vector<T> values;
values.push_back(T(new int(), deleter));
values.push_back(T(new int(), deleter));
}
}}}
You assessment about the MSVC behaviour agrees with mine. Boost.Container
should still work thanks to the interaction of those two bugs :) I have
looked at the 2015 preview, and it seems that they have fixed
`std::is_copy_constructible` and `std::is_copy_assignable`, but not
`__has_trivial_copy`, `__has_trivial_assign` and
`std::is_trivially_copyable`. I have filed a bug about the latter, but
whether or not it is fixed should not affect Boost.Container, as the
`std::is_copy_constructible` and `std::is_copy_assignable` not correctly
return false in this case.
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11229#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic