summaryrefslogtreecommitdiff
path: root/indra/llcommon/llregistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llregistry.h')
-rw-r--r--indra/llcommon/llregistry.h34
1 files changed, 4 insertions, 30 deletions
diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h
index 2df9bc6541..853c427a13 100644
--- a/indra/llcommon/llregistry.h
+++ b/indra/llcommon/llregistry.h
@@ -31,44 +31,18 @@
#include <boost/type_traits.hpp>
#include "llsingleton.h"
-#include "lltypeinfolookup.h"
+#include "llstl.h"
template <typename T>
struct LLRegistryDefaultComparator
{
- // It would be Bad if this comparison were used for const char*
- BOOST_STATIC_ASSERT(! (boost::is_same<typename boost::remove_const<typename boost::remove_pointer<T>::type>::type, char>::value));
- bool operator()(const T& lhs, const T& rhs) const { return lhs < rhs; }
-};
-
-// comparator for const char* registry keys
-template <>
-struct LLRegistryDefaultComparator<const char*>
-{
- bool operator()(const char* lhs, const char* rhs) const
+ bool operator()(const T& lhs, const T& rhs) const
{
- return strcmp(lhs, rhs) < 0;
+ using std::less;
+ return less<T>()(lhs, rhs);
}
};
-template <typename KEY, typename VALUE>
-struct LLRegistryMapSelector
-{
- typedef std::map<KEY, VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<std::type_info*, VALUE>
-{
- typedef LLTypeInfoLookup<VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<const std::type_info*, VALUE>
-{
- typedef LLTypeInfoLookup<VALUE> type;
-};
-
template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> >
class LLRegistry
{