Commit Graph

15 Commits

Author SHA1 Message Date
Joakim Hove
659fb45d04 Changed string_view::substr() to take(from, len) arguments 2019-08-16 09:04:49 +02:00
Joakim Hove
cf6161ecfe Add method string_view::find( char ) 2019-08-16 09:04:49 +02:00
Joakim Hove
9d9099a8fc Add string_view::starts_with() and string_view::find() methods 2019-08-10 18:05:22 +02:00
Arne Morten Kvarving
aa21cd8b13 quell cppcheck warnings for non-explicit constructor
- the implicit casts from std::string/char* is part of the design for
the view class so we do not want to disable those.
- intializer list constructors should be implicitly called
2017-06-09 17:38:42 +02:00
Jørgen Kvalsvik
508be3ecd5 Fix warnings in Stringview 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
a105f3a193 string_view char* constructor 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
6b64796d49 Add char* constructor to string_view
Mostly relevant for testing, this enables string_view to work as
expected with string literals.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
b648719513 Base string_view on char*, not string::iterator
By representing string_view as char* instead of
std::string::const_iterator the string_view class bring possibly
slightly lower overhead, but mostly enables some optimisations.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
bda128ee23 front/back support in string_view 2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
a93507087d string_view operator< and operator== support
In order for string_view to be useful as container member and sorting,
it has to support operator< and operator==
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
2d1075efcb Check argument length in string_view == char*
Not doing this opens up for undefined behaviour when char* is shorter
than view.
2016-04-25 15:20:27 +02:00
Jørgen Kvalsvik
23f01511bd Add string_view::empty() 2016-03-15 16:42:02 +01:00
Atgeirr Flø Rasmussen
32439fa87d Remove unused boost-specific helpers. 2016-03-14 14:54:00 +01:00
Atgeirr Flø Rasmussen
2e1940e5c3 Move string_view ops to Opm namespace. 2016-03-14 13:28:51 +01:00
Jørgen Kvalsvik
8d4863ff86 Introducing string_view
A simple non-mutating view into a string. Implements a shallow reference
to a std::string, replicating its operations to be drop-in replaceable.

Primarily designed for inner loop use, where expensive string
allocations become a performance killer.
2016-03-14 08:29:53 +01:00