fork download
  1. #include <cstdlib>
  2.  
  3. //////////////////////////////////////////////////////////////////////////////////////
  4.  
  5. struct Foo
  6. {
  7. };
  8.  
  9. struct Bar
  10. {
  11. };
  12.  
  13. //////////////////////////////////////////////////////////////////////////////////////
  14.  
  15. struct Attribute1
  16. {
  17. static const bool CAN_BE_BUFFERED = true;
  18. };
  19.  
  20. struct Attribute2
  21. {
  22. static const bool CAN_BE_BUFFERED = false;
  23. };
  24.  
  25. //////////////////////////////////////////////////////////////////////////////////////
  26.  
  27. template<typename P>
  28. struct Sequencer
  29. {
  30. template<typename A , bool = A::CAN_BE_BUFFERED>
  31. struct Process;
  32. };
  33.  
  34. //////////////////////////////////////////////////////////////////////////////////////
  35.  
  36. template<typename P>
  37. template<typename A>
  38. struct Sequencer<P>::Process<A,true>
  39. {
  40. };
  41.  
  42. template<typename P>
  43. template<typename A>
  44. struct Sequencer<P>::Process<A,false>
  45. {
  46. };
  47.  
  48. //////////////////////////////////////////////////////////////////////////////////////
  49.  
  50. template<>
  51. struct Sequencer<Bar>
  52. {
  53. template<typename A>
  54. struct Process;
  55. };
  56.  
  57. //////////////////////////////////////////////////////////////////////////////////////
  58.  
  59. template<typename A>
  60. struct Sequencer<Bar>::Process<A>
  61. {
  62. };
  63.  
  64. //////////////////////////////////////////////////////////////////////////////////////
  65.  
  66. int main()
  67. {
  68. Sequencer<Bar> h1;
  69. Sequencer<Foo> h2;
  70.  
  71. return EXIT_SUCCESS;
  72. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:60:24: error: partial specialization ‘Sequencer<Bar>::Process<A>’ does not specialize any template arguments
prog.cpp: In function ‘int main()’:
prog.cpp:68:17: warning: unused variable ‘h1’ [-Wunused-variable]
prog.cpp:69:17: warning: unused variable ‘h2’ [-Wunused-variable]
stdout
Standard output is empty