Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. void f(int) noexcept { }
  2. void f(int, int) { }
  3.  
  4. int main() {
  5. static_assert(noexcept(f(0)), "!");
  6. static_assert(not noexcept(f(0, 0)), "!");
  7. }
  8.  
  9. #include<utility>
  10.  
  11. struct S { S(int) {} };
  12.  
  13. void f(S) noexcept { }
  14.  
  15. int main() {
  16. static_assert(noexcept(f(std::declval<S>())), "!");
  17. }
  18.  
  19. int a(int) noexcept;
  20. int a(int, int);
  21.  
  22. // What would `noexcept(a)` mean?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement