utils.hpp 543 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <string>
  3. #include <boost/variant/apply_visitor.hpp>
  4. namespace mstch {
  5. using citer = std::string::const_iterator;
  6. using criter = std::string::const_reverse_iterator;
  7. citer first_not_ws(citer begin, citer end);
  8. citer first_not_ws(criter begin, criter end);
  9. std::string html_escape(const std::string& str);
  10. criter reverse(citer it);
  11. template<class... Args>
  12. auto visit(Args&&... args) -> decltype(boost::apply_visitor(
  13. std::forward<Args>(args)...))
  14. {
  15. return boost::apply_visitor(std::forward<Args>(args)...);
  16. }
  17. }