Explicity disallow get_idx for boolean type, to avoid ambiguity with a map.

This commit is contained in:
Jesse Beder
2013-04-01 22:06:09 -05:00
parent 04937649b7
commit f5418306d6

View File

@@ -22,7 +22,7 @@ namespace YAML
};
template<typename Key>
struct get_idx<Key, typename boost::enable_if<boost::is_unsigned<Key> >::type> {
struct get_idx<Key, typename boost::enable_if_c<boost::is_unsigned<Key>::value && !boost::is_same<Key, bool>::value>::type> {
static node *get(const std::vector<node *>& sequence, const Key& key, shared_memory_holder /* pMemory */) {
return key < sequence.size() ? sequence[key] : 0;
}