fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace UART {
  5. template<int t_baud, int t_stop, int t_bit, int t_parity>
  6. struct A {//名前は任せる。
  7. static const int baud = t_baud;
  8. static const int stop = t_stop;
  9. static const int bit = t_bit;
  10. static const int parity = t_parity;
  11. A() {}
  12. ~A() {}
  13. };
  14. typedef A<115200, 1, 8, 0> A0;
  15. typedef A<9600, 2, 8, 1> A1;
  16. }
  17.  
  18. int main() {
  19. cout << UART::A0::baud << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 4428KB
stdin
Standard input is empty
stdout
115200