registry_via_id_test_2.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // test registry_via_id's requirement that the value type have
4 // a member function that is:
5 // 1) named id, and
6 // 2) returns a value of the key type
7 //
8 // ======================================================================
9 
10 #include "cetlib/registry_via_id.h"
11 
12 typedef int success_t;
13 typedef char* fail_t; // anything other than success_t
14 
15 struct val {
16  success_t
17  // fail_t
18  id() const
19  {
20  return 0;
21  }
22 };
23 
25 
26 int
28 {
29  reg::put(val());
30 
31  return 0;
32 } // main()
success_t id() const
int success_t
int main()
static detail::must_have_id< K, V >::type put(V const &value)
cet::registry_via_id< success_t, val > reg
char * fail_t