fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. int main() {
  5.  
  6. int a = 0;
  7. const auto* b = &a;
  8.  
  9. static_assert(std::is_same<decltype(b), const int*>::value, "unexpected type");
  10. b = nullptr; // Ok
  11. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
Standard output is empty