refs #624 Use auto function return type deduction.

This commit is contained in:
Mathew Sutcliffe
2016-03-19 23:37:51 +00:00
parent 4700cb1602
commit eb4df2d893
8 changed files with 42 additions and 85 deletions

View File

@@ -53,16 +53,16 @@ namespace BlackMisc
//! @}
//! Return the value at this iterator position.
auto value() const -> decltype(std::declval<I>().value()) { return m_iterator.value(); }
auto value() const { return m_iterator.value(); }
//! Return the key at this iterator position.
//! @{
auto key() const -> decltype(std::declval<I>().key()) { return m_iterator.key(); }
auto operator *() const -> decltype(std::declval<I>().key()) { return key(); }
auto key() const { return m_iterator.key(); }
auto operator *() const { return key(); }
//! @}
//! Indirection operator: pointer to the key at this iterator position.
auto operator ->() const -> typename std::remove_reference<decltype(std::declval<I>().key())>::type * { return &key(); }
auto operator ->() const { return &key(); }
//! Equality operators.
//! @{