From 36bc5aea445a0773d1f28ab8893f7b2ca7c467d4 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Mon, 3 Feb 2014 16:22:27 +0400 Subject: [PATCH] Attempt to fix access violation during forwarding of arrays on MSVC --- include/boost/lexical_cast.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index cf1d700..50af834 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -2096,7 +2096,8 @@ namespace boost { template struct copy_converter_impl { -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +// MSVC fail to forward an array. This error is reported to MSVC's developer. +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MSVC) template static inline bool try_convert(T&& arg, Target& result) { result = static_cast(arg); // eqaul to `result = std::forward(arg);` @@ -2250,7 +2251,8 @@ namespace boost { namespace conversion { namespace detail { -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +// MSVC fail to forward an array. This error is reported to MSVC's developer. +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MSVC) template inline bool try_lexical_convert(Source&& arg, Target& result) {