Author Topic: It works on Visual Studio,But on CodeBlocks it doesn't work  (Read 138 times)

Offline tilblackout

  • Single posting newcomer
  • *
  • Posts: 2
friend ostream& operator<<(ostream& os ,Fraction &&obj)
error: expected ',' or '...' before '&&' token|。
On VS there is no error.
How can I solve it?

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 251
Re: It works on Visual Studio,But on CodeBlocks it doesn't work
« Reply #1 on: May 10, 2019, 12:49:35 pm »
rvalue references needs a C++11 or newer compiler, did you activate C++11 mode in whatever compiler you are using (CodeBlocks is not a compiler)?

Offline tilblackout

  • Single posting newcomer
  • *
  • Posts: 2
Re: It works on Visual Studio,But on CodeBlocks it doesn't work
« Reply #2 on: May 10, 2019, 01:04:11 pm »
THX,Solved.