Guest User

Untitled

a guest
Jun 14th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. struct test_struct {
  4. int a;
  5. int b;
  6. int c;
  7. };
  8.  
  9. constexpr test_struct test1 = [] {
  10. test_struct t{};
  11. t.c = 1;
  12. t.a = 2;
  13. return t;
  14. }();
  15.  
  16. int main() {
  17. std::cout << test1.a;
  18. }
Add Comment
Please, Sign In to add comment