fork download
  1. #include <string>
  2. #include <string_view>
  3. #include <iostream>
  4. #include <boost/algorithm/string.hpp>
  5. int main()
  6. {
  7. auto str = std::string_view{""};
  8.  
  9. for( boost::algorithm::split_iterator<std::string_view::iterator> i
  10. // = make_split_iterator(str, token_finder(is_space()));
  11. = make_split_iterator(str, boost::first_finder(","));
  12. i != boost::algorithm::split_iterator<std::string_view::iterator>();
  13. ++i)
  14. {
  15. std::cout << *i << '\n';
  16. }
  17. std::cout << "ok";
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 5324KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:25: error: ‘string_view’ is not a member of ‘std’
         auto str = std::string_view{""};
                         ^~~~~~~~~~~
prog.cpp:7:25: note: ‘std::string_view’ is only available from C++17 onwards
prog.cpp:9:52: error: ‘string_view’ is not a member of ‘std’
         for( boost::algorithm::split_iterator<std::string_view::iterator> i
                                                    ^~~~~~~~~~~
prog.cpp:9:52: note: ‘std::string_view’ is only available from C++17 onwards
prog.cpp:9:52: error: ‘string_view’ is not a member of ‘std’
prog.cpp:9:52: note: ‘std::string_view’ is only available from C++17 onwards
prog.cpp:9:73: error: template argument 1 is invalid
         for( boost::algorithm::split_iterator<std::string_view::iterator> i
                                                                         ^
prog.cpp:12:57: error: ‘string_view’ is not a member of ‘std’
              i != boost::algorithm::split_iterator<std::string_view::iterator>();
                                                         ^~~~~~~~~~~
prog.cpp:12:57: note: ‘std::string_view’ is only available from C++17 onwards
prog.cpp:12:57: error: ‘string_view’ is not a member of ‘std’
prog.cpp:12:57: note: ‘std::string_view’ is only available from C++17 onwards
prog.cpp:12:78: error: template argument 1 is invalid
              i != boost::algorithm::split_iterator<std::string_view::iterator>();
                                                                              ^
prog.cpp:15:31: error: invalid type argument of unary ‘*’ (have ‘int’)
                 std::cout << *i << '\n';
                               ^
stdout
Standard output is empty