This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/61528] std::min std::max and RValue


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]