August 2017
Intermediate to advanced
438 pages
14h 19m
English
We do not really need a std::string class here, we only need some lightweight class that does not manage resources and only has a pointer to the character array and array's size. Boost has the boost::string_view class for that.
#include <boost/utility/string_view.hpp>
boost::string_view between( boost::string_view input, char starts, char ends)
{ boost::string_view::const_iterator pos_beg = std::find(input.cbegin(), input.cend(), starts); if (pos_beg == input.cend()) { return boost::string_view(); } ++ pos_beg; boost::string_view::const_iterator ...Read now
Unlock full access