ROOT  6.06/09
Reference Guide
RStringView.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Author: Philippe Canal, March 2015
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef RStringView_H
13 #define RStringView_H
14 
15 #include "RConfigure.h"
16 
17 #ifdef R__HAS_STD_STRING_VIEW
18 
19 #include <string_view>
20 
21 #else
22 
23 # if defined(R__HAS_STD_EXPERIMENTAL_STRING_VIEW)
24 # include <experimental/string_view>
25 # else
27 # endif
28 
29 namespace std {
30 
31  template<class _CharT, class _Traits = std::char_traits<_CharT> >
32  using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
33 
34  // basic_string_view typedef names
39 
40 // template<class _CharT, class _Traits = std::char_traits<_CharT> >
41 // basic_string_view<_CharT,_Traits>
42 // &operator=(basic_string_view<_CharT,_Traits> &lhs, const TString &rsh) {
43 // *lhs = basic_string_view<_CharT,_Traits>(rsh);
44 // return *lhs;
45 // }
46 
47 #ifndef R__HAS_STOD_STRING_VIEW
48  inline double stod(std::string_view str, size_t *pos)
49  {
50  return std::stod(str.to_string(),pos);
51  }
52 #endif
53 
54 }
55 
56 #endif // ifdef else R__HAS_STD_STRING_VIEW
57 
58 #endif // RStringView_H
STL namespace.
basic_string_view< char > string_view
basic_string_view< wchar_t > wstring_view
basic_string_view< char32_t > u32string_view
basic_string_view< char16_t > u16string_view