refs #437 Adjust static assert, caught one more case of CVariant containing CVariant.

This commit is contained in:
Mathew Sutcliffe
2015-06-01 18:00:16 +01:00
parent 6a2af9d387
commit 8db8fdef94
2 changed files with 3 additions and 3 deletions

View File

@@ -174,14 +174,14 @@ namespace BlackMisc
//! Construct a variant from a value.
template <typename T> static CVariant fromValue(T &&value)
{
static_assert(!std::is_same<CVariant, T>::value, "CVariant is an illegal type!");
static_assert(!std::is_same<CVariant, typename std::decay<T>::type>::value, "CVariant is an illegal type!");
return CVariant(QVariant::fromValue(std::forward<T>(value)));
}
//! Synonym for fromValue().
template <typename T> static CVariant from(T &&value)
{
static_assert(!std::is_same<CVariant, T>::value, "CVariant is an illegal type!");
static_assert(!std::is_same<CVariant, typename std::decay<T>::type>::value, "CVariant is an illegal type!");
return CVariant(QVariant::fromValue(std::forward<T>(value)));
}