Avoid astyle's padding in ordered_map::emplace's template headers
Use detail::conjunction instead of && and drop the redundant V&& in detail::is_constructible, so astyle keeps the usual template formatting. Addresses review comment by @gregmarr. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+10
-10
No files matched your search
@@ -70,8 +70,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class V, detail::enable_if_t <
|
template<class V, detail::enable_if_t<
|
||||||
detail::is_constructible < T, V&& >::value, int > = 0 >
|
detail::is_constructible<T, V>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(const key_type& key, V && t)
|
std::pair<iterator, bool> emplace(const key_type& key, V && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
@@ -85,9 +85,9 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class KeyType, class V, detail::enable_if_t <
|
template<class KeyType, class V, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value&&
|
detail::conjunction<detail::is_usable_as_key_type<key_compare, key_type, KeyType>,
|
||||||
detail::is_constructible < T, V&& >::value, int > = 0 >
|
detail::is_constructible<T, V>>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(KeyType && key, V && t)
|
std::pair<iterator, bool> emplace(KeyType && key, V && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
|
|||||||
@@ -25832,8 +25832,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class V, detail::enable_if_t <
|
template<class V, detail::enable_if_t<
|
||||||
detail::is_constructible < T, V&& >::value, int > = 0 >
|
detail::is_constructible<T, V>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(const key_type& key, V && t)
|
std::pair<iterator, bool> emplace(const key_type& key, V && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
@@ -25847,9 +25847,9 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class KeyType, class V, detail::enable_if_t <
|
template<class KeyType, class V, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value&&
|
detail::conjunction<detail::is_usable_as_key_type<key_compare, key_type, KeyType>,
|
||||||
detail::is_constructible < T, V&& >::value, int > = 0 >
|
detail::is_constructible<T, V>>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(KeyType && key, V && t)
|
std::pair<iterator, bool> emplace(KeyType && key, V && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
|
|||||||
Reference in new issue
Block a user