3

I found this piece of code:

std::string(avdInfo_getSystemImagePath(m_avd)
                                ?: avdInfo_getSystemInitImagePath(m_avd))

I only found information about the conditional operator: http://www.cplusplus.com/articles/1AUq5Di1/

That is, ? and : are separated. But what does it mean when they are together? both avdInfo_getSystemImagePath and avdInfo_getSystemInitImagePath return char*

Boann
  • 48,794
  • 16
  • 117
  • 146
Gatonito
  • 1,662
  • 5
  • 26
  • 55

1 Answers1

7

It's a GCC extension.

x ?: y

is the same as

x ? x : y

Except that x will only be evaluated once.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469