Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // std::array{ '1','2','3' }
  2. constexpr auto a_1 = 123_std_char_array;
  3.  
  4. // std::array{ '0','x','1','2' }
  5. constexpr auto a_2 = 0x12_std_char_array;
  6.  
  7. // std::array{ '4'.'2','.','1','3' }
  8. constexpr auto a_3 = 42.13_std_char_array;
  9.  
  10. template< char ... Chs >
  11. inline constexpr decltype(auto) operator"" _std_char_array( )
  12. {
  13. // template guide makes this possible
  14. return std::array { Chs... } ;
  15. }
  16.  
  17. // std::array {'S','t','r','i','n','g'}
  18. constexpr auto std_char_array_buff_ =
  19. "String"_std_char_array ;
  20.  
  21. inline auto operator"" _X( const char*, size_t);
  22.  
  23. constexpr auto string_view_ = "String"sv ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement