This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61528] std::min std::max and RValue
- From: "lisp2d at lisp2d dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Jun 2014 19:54:36 +0000
- Subject: [Bug c++/61528] std::min std::max and RValue
- Auto-submitted: auto-generated
- References: <bug-61528-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61528
--- Comment #4 from Lisp2D <lisp2d at lisp2d dot net> ---
Likely error in the standard. The right set of functions must return a copy of
the data and return a the temporary link with real data.
Working version of it:
size_t const & min2(size_t const & x,size_t const & y){
return std::min(x,y);}
size_t min2(size_t const && x,size_t const & y){
return {std::min(x,y)};}
size_t min2(size_t const & x,size_t const && y){
return {std::min(x,y)};}
May be do like this?