aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-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>