Silicium
noexcept_string.hpp
Go to the documentation of this file.
1 #ifndef SILICIUM_NOEXCEPT_STRING_HPP
2 #define SILICIUM_NOEXCEPT_STRING_HPP
3 
4 #include <string>
5 
6 #ifndef _MSC_VER
7 # include <boost/container/string.hpp>
8 #endif
9 
10 namespace Si
11 {
12 #ifdef _MSC_VER
13  //boost string does not work at all on VC++ 2013 Update 3, so we use std::string instead
14  typedef std::string noexcept_string;
15 
16  inline noexcept_string &&to_noexcept_string(noexcept_string &&str)
17  {
18  return std::move(str);
19  }
20 
21  inline noexcept_string to_noexcept_string(noexcept_string const &str)
22  {
23  return str;
24  }
25 #else
26  typedef boost::container::string noexcept_string;
27 
28  inline noexcept_string to_noexcept_string(std::string const &str)
29  {
30  return noexcept_string(str.data(), str.size());
31  }
32 
33  inline noexcept_string &&to_noexcept_string(noexcept_string &&str)
34  {
35  return std::move(str);
36  }
37 
38  inline noexcept_string to_noexcept_string(noexcept_string const &str)
39  {
40  return str;
41  }
42 #endif
43 }
44 
45 #endif
std::remove_reference< T >::type && move(T &&ref)
Definition: move.hpp:10
noexcept_string to_noexcept_string(std::string const &str)
Definition: noexcept_string.hpp:28
Definition: absolute_path.hpp:19
boost::container::string noexcept_string
Definition: noexcept_string.hpp:26