From 31b36d136de6f05b39247e927ba0d4bb02cd3f09 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 1 May 2014 15:29:43 -0700 Subject: [PATCH] value_init and swap work on nvidia gpu's --- include/boost/utility/swap.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/utility/swap.hpp b/include/boost/utility/swap.hpp index 6845e79..5ee6dc1 100644 --- a/include/boost/utility/swap.hpp +++ b/include/boost/utility/swap.hpp @@ -21,12 +21,15 @@ // avoid ambiguity when swapping objects of a Boost type that does // not have its own boost::swap overload. -#include //for std::swap +#include //for std::swap (C++11) +#include //for std::swap (C++98) #include //for std::size_t +#include namespace boost_swap_impl { template + BOOST_GPU_ENABLED void swap_impl(T& left, T& right) { using namespace std;//use std::swap if argument dependent lookup fails @@ -34,6 +37,7 @@ namespace boost_swap_impl } template + BOOST_GPU_ENABLED void swap_impl(T (& left)[N], T (& right)[N]) { for (std::size_t i = 0; i < N; ++i) @@ -46,6 +50,7 @@ namespace boost_swap_impl namespace boost { template + BOOST_GPU_ENABLED void swap(T1& left, T2& right) { ::boost_swap_impl::swap_impl(left, right);