From 918e2b629bd3dadfbe5288c0d72d93bcca1b8cfe Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Oct 2014 20:23:08 -0700 Subject: Bring in new TUT library build. Clean up ensure_equals() overloads. The new TUT library build eliminates the ambiguity about ensure_equals(const char*, ...) versus ensure_equals(const std::string&, ...). Now it's all based on const std::string&. Remove pointless const char* overloads and ambiguous forwarding templates. With clang in Xcode 6, any new datatypes we intend to use with ensure_equals() must have operator<<(std::ostream&, datatype) declared BEFORE lltut.h #includes tut.hpp. Reorder code in certain test source files to guarantee that visibility. --- indra/llcommon/tests/lldependencies_test.cpp | 46 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'indra/llcommon/tests/lldependencies_test.cpp') diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp index 5395d785b6..b5e189a465 100755 --- a/indra/llcommon/tests/lldependencies_test.cpp +++ b/indra/llcommon/tests/lldependencies_test.cpp @@ -37,29 +37,14 @@ // associated header #include "../lldependencies.h" // other Linden headers -#include "../test/lltut.h" - -using boost::assign::list_of; #if LL_WINDOWS #pragma warning (disable : 4675) // "resolved by ADL" -- just as I want! #endif -typedef LLDependencies<> StringDeps; -typedef StringDeps::KeyList StringList; - -// We use the very cool boost::assign::list_of() construct to specify vectors -// of strings inline. For reasons on which I'm not entirely clear, though, it -// needs a helper function. You can use list_of() to construct an implicit -// StringList (std::vector) by conversion, e.g. for a function -// parameter -- but if you simply write StringList(list_of("etc.")), you get -// ambiguity errors. Shrug! -template -CONTAINER make(const CONTAINER& data) -{ - return data; -} - +/***************************************************************************** +* Display helpers: must be defined BEFORE lltut.h! +*****************************************************************************/ // Display an arbitary value as itself... template std::ostream& display(std::ostream& out, const T& value) @@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set& set) return out; } +/***************************************************************************** +* Now we can #include lltut.h +*****************************************************************************/ +#include "../test/lltut.h" + +/***************************************************************************** +* Other helpers +*****************************************************************************/ +using boost::assign::list_of; + +typedef LLDependencies<> StringDeps; +typedef StringDeps::KeyList StringList; + +// We use the very cool boost::assign::list_of() construct to specify vectors +// of strings inline. For reasons on which I'm not entirely clear, though, it +// needs a helper function. You can use list_of() to construct an implicit +// StringList (std::vector) by conversion, e.g. for a function +// parameter -- but if you simply write StringList(list_of("etc.")), you get +// ambiguity errors. Shrug! +template +CONTAINER make(const CONTAINER& data) +{ + return data; +} + const std::string& extract_key(const LLDependencies<>::value_type& entry) { return entry.first; -- cgit v1.2.3