Logo
Explore Help
Sign In
OilfieldToolsNet/opm-common
4
0
Fork 0
You've already forked opm-common
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
7d67ddc09960f2ae7290f061b8de43fedb83bca1
opm-common/opm/parser/eclipse/Utility/Stringview.cpp

10 lines
285 B
C++
Raw Normal View History

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-02 11:43:05 +01:00
#include <iterator>
#include <ostream>
#include <opm/parser/eclipse/Utility/Stringview.hpp>
Move string_view ops to Opm namespace.
2016-03-14 13:28:51 +01:00
std::ostream& Opm::operator<<( std::ostream& stream, const Opm::string_view& view ) {
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-02 11:43:05 +01:00
std::copy( view.begin(), view.end(), std::ostream_iterator< char >( stream ) );
return stream;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 25ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API