mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Fix for CRange::frontOrDefault to support classes with defaulted (C++11 §8.4.2/4) default constructors.
This commit is contained in:
@@ -171,7 +171,7 @@ namespace BlackMisc
|
|||||||
//! Returns the element at the beginning of the range, or a default value if the range is empty.
|
//! Returns the element at the beginning of the range, or a default value if the range is empty.
|
||||||
const_reference frontOrDefault() const
|
const_reference frontOrDefault() const
|
||||||
{
|
{
|
||||||
static const value_type def;
|
static const value_type def{};
|
||||||
return empty() ? def : *begin();
|
return empty() ? def : *begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user