title: Preventing some templates to be defined
body: <p>I am designing a Dynamic class that can store any kind of value. It is defined as:</p>
  
  <pre><code>class Dynamic {
   private:
    Type type_;
    std::uint64_t data_;
  
   public:
    Dynamic();
    ... 
  }
  </code></pre>
  
  <p>where Type is an enum that contains ids of all the types I can store in the Dynamic object : <code>unsigned char</code>, <code>signed char</code>, <code>char</code>, ..., <code>unsigned short</code>, <code>short</code>, <code>std::size_t</code>, <code>std::ptrdiff_t</code>, <code>float</code>, <code>double</code>, <code>std::vector&lt;unsigned char&gt;</code>, ..., <code>std::vector&lt;double&gt;</code>, etc. Think about 200 types.</p>
  
  <p>I would like to construct the Dynamic object very easily. If the type T is supported, the following code should work.</p>
  
  <pre><code>void f(const T&amp; x) {
    il::Dynamic d = x;
    ...
  }
  </code></pre>
  
  <p>It could be implemented very easily with the following constructor:</p>
  
  <pre><code>template &lt;typename T&gt;
  Dynamic(const T&amp; x) {
    ...
  }
  </code></pre>
  
  <p>except that I have the following problem. On 64-bit platforms</p>
  
  <pre><code>const il::Dynamic d0 = 1'000'000'000;
  </code></pre>
  
  <p>would create an Dynamic containing an int, and</p>
  
  <pre><code>const il::Dynamic d1 = 10'000'000'000;
  </code></pre>
  
  <p>would create something else (don't even want to know if it is a long, or a long long). I don't want that, and the only integer type I want to use above 32 bits is a signed integer of the same size as <code>std::size_t</code> which is <code>std::ptrdiff_t</code>. As a consequence, I want to prevent the constructor to work with the following types : <code>int</code>, <code>unsigned int</code>, <code>long</code>, <code>unsigned long</code>, <code>long long</code>, <code>unsigned long long</code>, except one which is <code>std::ptrdiff_t</code>. How could I do such as thing?</p>