dingo's blog

By dingo, history, 3 years ago, In English

You can use this: Use min({a,b,c}) instead of min(a,min(b,c)).

C++ is evolving ,are you?

  • Vote: I like it
  • -24
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

that feature has existed since C++11, so around 10 years ago

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Then why does it give error on my compiler? I'm using gcc 4.3.0

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think GCC 4 is too old

      At least here it says std::max with initializer list being a parameter has existed since C++11

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Then why does it give error on my compiler? I'm using gcc 4.3.0

      Does adding -std=c++0x option to the compiler command line make it work? That's an older name of the C++11 draft before it got finalized. Ancient compilers may accept it.

»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

We know.