diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-03-17 14:39:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-03-17 14:39:28 +0200 |
commit | d13eb80e2f4114a97c523a7273d7de4c587dd22a (patch) | |
tree | 1ad6fc0694f694f36e44dd8b264a4adc6e49fb8d /butl/string-table | |
parent | 8b5e3e0a8f9ec8852cf2f15dab53bfa4436bea87 (diff) |
Minor string_table improvement
Diffstat (limited to 'butl/string-table')
-rw-r--r-- | butl/string-table | 9 |
1 files changed, 8 insertions, 1 deletions
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 <typename D> - struct string_table_traits; + struct string_table_traits + { + static const std::string& + key (const D& d) {return d.key;} + }; template <> struct string_table_traits<std::string> |