title: exposing constant in Boost.Python outside of any class scope
body: <p>I have following constant in C++ code</p>
  
  <pre><code>enum
  {
      BOUNDARY_NONE = -1,
  };
  </code></pre>
  
  <p>I would like to expose it to Python with Boost.Python so that it will be available in Python as just <code>BOUNDARY_NONE</code>. I dont want to define it under any aditional scope.</p>
  
  <p>I found how to do this with Boost.Python v1</p>
  
  <pre><code>#include &lt;boost/python/reference.hpp&gt;
  my_module_builder.add(make_ref(BOUNDARY_NONE), "BOUNDARY_NONE");
  </code></pre>
  
  <p>But I use newer version of Python and I dont know how to access to my_module_builder with it (I use BOOST_PYTHON_MODULE instead).</p>
  
  <p><a href="https://stackoverflow.com/questions/6877587/exposing-static-constant-with-boost">Here</a> similar question appears but they are adding constant to class scope, and I dont have any class scope to use.</p>