title: Strong typedef for primitive types (BOOST_STRONG_TYPEDEF is not cutting it)
body: <p>I have used <code>BOOST_STRONG_TYPEDEF</code> before, mainly with <code>std::string</code> and I got satisfactory results:</p>
  
  <pre><code>#include &lt;boost/serialization/strong_typedef.hpp&gt;
  #include &lt;iostream&gt;
  
  BOOST_STRONG_TYPEDEF(std::string, TIMER_ID)
  BOOST_STRONG_TYPEDEF(std::string, PROCESS_ID)
  
  int main()
  {
      TIMER_ID t_id("Timer");
      PROCESS_ID p_id("Process");
  
      if (t_id == p_id)
          std::cout &lt;&lt; "They are equal!" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>The previous code fails to compile as expected:</p>
  
  <pre><code>In file included from /usr/include/boost/serialization/strong_typedef.hpp:26:0,
                   from types.cpp:1:
  /usr/include/boost/operators.hpp: In instantiation of ‘bool boost::operator==(const std::__cxx11::basic_string&lt;char&gt;&amp;, const PROCESS_ID&amp;)’:
  types.cpp:12:14:   required from here
  /usr/include/boost/operators.hpp:144:64: error: no match for ‘operator==’ (operand types are ‘const PROCESS_ID’ and ‘const std::__cxx11::basic_string&lt;char&gt;’)
        friend bool operator==(const U&amp; y, const T&amp; x) { return x == y; }
  </code></pre>
  
  <p>However, this code compiles just fine:</p>
  
  <pre><code>#include &lt;boost/serialization/strong_typedef.hpp&gt;
  #include &lt;iostream&gt;
  
  BOOST_STRONG_TYPEDEF(unsigned int, TIMER_ID)
  BOOST_STRONG_TYPEDEF(unsigned int, PROCESS_ID)
  
  int main()
  {
      TIMER_ID t_id(12);
      PROCESS_ID p_id(12);
  
      if (t_id == p_id)
      {
          std::cout &lt;&lt; "They are equal!" &lt;&lt; std::endl;
          std::cout &lt;&lt; "Their sum is " &lt;&lt; t_id + p_id &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>This doesn't seem strong at all! I would expect to not be able to compare or add objects of two different types without a <code>static_cast</code>.</p>
  
  <ul>
  <li>Why is this happening?</li>
  <li>How can one accomplish type safety with primitive types without manually creating classes for each type?</li>
  </ul>