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
  • 47,128
  • 13
  • 114
  • 141
Gatonito
  • 1,028
  • 2
  • 13
  • 38

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
  • 210,715
  • 34
  • 410
  • 462