mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fixes ES.50 example and closes #1682
Also removes the only use of `decltype` in the Guidelines, FTW.
This commit is contained in:
parent
55bea2089b
commit
6ad29ce609
|
@ -11806,7 +11806,7 @@ Instead, prefer to put the common code in a common helper function -- and make i
|
|||
Bar my_bar;
|
||||
|
||||
template<class T> // good, deduces whether T is const or non-const
|
||||
static auto get_bar_impl(T& t) -> decltype(t.get_bar())
|
||||
static auto& get_bar_impl(T& t)
|
||||
{ /* the complex logic around getting a possibly-const reference to my_bar */ }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user