From d13eb80e2f4114a97c523a7273d7de4c587dd22a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Mar 2017 14:39:28 +0200 Subject: Minor string_table improvement --- butl/string-table | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/butl/string-table b/butl/string-table index 4f2ed1f..a1d60c3 100644 --- a/butl/string-table +++ b/butl/string-table @@ -34,8 +34,15 @@ namespace butl const std::string d; }; + // For custom data the options are to call the data member 'key' or to + // specialize this traits. + // template - struct string_table_traits; + struct string_table_traits + { + static const std::string& + key (const D& d) {return d.key;} + }; template <> struct string_table_traits -- cgit v1.1