Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/nntpchan-daemon/libmustache/utils.hpp

22 lines
539 B
C++
Raw Normal View History

2017-10-11 18:48:27 +05:00
#pragma once
#include <boost/variant/apply_visitor.hpp>
2017-10-17 19:29:56 +05:00
#include <string>
2017-10-11 18:48:27 +05:00
2017-10-17 19:29:56 +05:00
namespace mstch
{
2017-10-11 18:48:27 +05:00
using citer = std::string::const_iterator;
using criter = std::string::const_reverse_iterator;
citer first_not_ws(citer begin, citer end);
citer first_not_ws(criter begin, criter end);
2017-10-17 19:29:56 +05:00
std::string html_escape(const std::string &str);
2017-10-11 18:48:27 +05:00
criter reverse(citer it);
2017-10-17 19:29:56 +05:00
template <class... Args> auto visit(Args &&... args) -> decltype(boost::apply_visitor(std::forward<Args>(args)...))
2017-10-11 18:48:27 +05:00
{
return boost::apply_visitor(std::forward<Args>(args)...);
}
}