aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-17 14:39:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-17 14:39:28 +0200
commitd13eb80e2f4114a97c523a7273d7de4c587dd22a (patch)
tree1ad6fc0694f694f36e44dd8b264a4adc6e49fb8d
parent8b5e3e0a8f9ec8852cf2f15dab53bfa4436bea87 (diff)
Minor string_table improvement
-rw-r--r--butl/string-table9
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>