MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / cast

Method cast

benchmarks/dlib/string/string.h:289–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287 {
288 template < typename charT, typename traits, typename alloc >
289 static const T cast (
290 const std::basic_string<charT,traits,alloc>& str
291 )
292 {
293 using namespace std;
294 basic_istringstream<charT,traits,alloc> sin(str);
295 T temp;
296 sin >> temp;
297 if (!sin) throw string_cast_error(narrow(str));
298 if (sin.get() != std::char_traits<charT>::eof()) throw string_cast_error(narrow(str));
299 return temp;
300 }
301 };
302
303 template <typename C, typename T, typename A>

Callers

nothing calls this directly

Calls 3

narrowFunction · 0.85
string_cast_errorClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected