fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T, typename F>
  5. typename std::conditional<1,T,F>::type f(){};
  6.  
  7.  
  8. int main() {
  9. // your code goes here
  10. const int b=1;
  11. *((int*)(&b))=0;
  12. printf("%d\n",*((const int*)&b));
  13. std::conditional<(*((int*)&b)),int,char*>::type a;
  14. printf("%ld\n",std::is_same<decltype(a),int>::value);
  15. return 0;
  16. }
Success #stdin #stdout 0s 4512KB
stdin
Standard input is empty
stdout
0
1