title: Writing and checking your own concepts in c++
body: <p>I am writing a header-only C++ library that uses templates quite a lot. Now I want to add some concepts checking to handle compile-time errors raised when incorrect types are used in template parameters.</p>
  
  <p>For example, I need concept for pointer-like objects that could point to a single object (like std::shared_ptr), pointer-like object that could point to an array (via operator[]) but couldn't be used with pointer arithmetic (like std::unique_ptr), and pointers that could be used  with pointer arithmetic and so on.</p>
  
  <p>Since concepts are still not in standard and not supported by the compilers, I need to implement this by myself. I know about Boost Concept library, but for some reason I do not want to add it to dependencies.</p>
  
  <p>So the question is, how to implement checking of some type requirements? How is it implemented in Boost? What techniques are common in such cases?</p>