fork download
  1. enum IdType {
  2. Book,
  3. Customer
  4. };
  5.  
  6. template <IdType Type>
  7. struct Id {
  8. int m_id;
  9. };
  10.  
  11. using BookId = Id<Book>;
  12. using CustomerId = Id<Customer>;
  13.  
  14. int main()
  15. {
  16. BookId book;
  17. CustomerId cust;
  18. book.m_id = 43;
  19. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty