From 54082bd65ec6abe1515c2a96d6879ed11dcc57f9 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 4 Feb 2022 15:55:25 +0100 Subject: type --- src/srcut.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/srcut.cpp b/src/srcut.cpp index 44131a0..119bfc3 100644 --- a/src/srcut.cpp +++ b/src/srcut.cpp @@ -8,8 +8,10 @@ using namespace std; +typedef map> container_type; + istream& -operator>>(istream& in, map>& container) +operator>>(istream& in, container_type& container) { static constexpr auto begin_marker = "--8<--"; static constexpr auto end_marker = "-->8--"; @@ -84,7 +86,7 @@ operator>>(istream& in, map>& container) } ostream& -print(ostream& os, const string& key, const map>& container) +print(ostream& os, const string& key, const container_type& container) { const auto it = container.find(key); if ( it != container.end() ) { @@ -107,6 +109,7 @@ main(int argc, char* argv[]) int show_tags = 0; int ch; + opterr = 0; while ( (ch = getopt(argc, argv, "t")) != -1 ) { switch ( ch ) { case 't': @@ -120,7 +123,7 @@ main(int argc, char* argv[]) argc -= optind; argv += optind; - map> container; + container_type container; cin >> container; -- cgit v1.3