Fix for CRange::frontOrDefault to support classes with defaulted (C++11 §8.4.2/4) default constructors.

This commit is contained in:
Mathew Sutcliffe
2014-11-15 13:34:35 +00:00
parent 8a3ba8bbed
commit 60e1f306f6

View File

@@ -171,7 +171,7 @@ namespace BlackMisc
//! Returns the element at the beginning of the range, or a default value if the range is empty.
const_reference frontOrDefault() const
{
static const value_type def;
static const value_type def{};
return empty() ? def : *begin();
}