title: boost::property_tree without exceptions
body: <p>I need to parse some INI files. To do this, I'm trying to use <code>boost::property_tree</code>, but in my system exceptions are not allowed.</p>
  
  <p>How can I disable the exception support when using <code>boost::property_tree</code>?</p>
  
  <p>If there's no way to do this, any recommendations for another library are very appreciated.</p>
  
  <p>After the answer from @sehe, I tried this piece of code, but without success:</p>
  
  <pre><code>#include &lt;iostream&gt;   
  #include &lt;string&gt;
  #include &lt;boost/property_tree/ptree.hpp&gt;
  #include &lt;boost/property_tree/ini_parser.hpp&gt;
  
  namespace boost {
      void throw_exception(std::exception const&amp; e) {
          std::cerr &lt;&lt; "Fake exception: " &lt;&lt; e.what() &lt;&lt; "\n";
          std::exit(255);
      }
  }
  
  class Foo {
      public:
        bool bar(const std::string file_name) {
          boost::property_tree::ptree prop_tree;
          boost::property_tree::read_ini(file_name, prop_tree);
  
          return !prop_tree.empty();
        }
  };
  </code></pre>
  
  <p>The compilation line code uses the following parameters:</p>
  
  <pre><code>-c -DBOOST_USER_CONFIG="&lt;user.hpp&gt;" -DBOOST_NO_EXCEPTIONS -DBOOST_EXCEPTION_DISABLE -I.\toolchain\boost -I.\include Foo.cpp
  </code></pre>
  
  <p>And finally, the <code>user.hpp</code> file:</p>
  
  <pre><code>#define BOOST_HAS_NRVO
  #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
  #define BOOST_NO_CXX11_AUTO_DECLARATIONS
  #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  #define BOOST_NO_CXX11_CHAR16_T
  #define BOOST_NO_CXX11_CHAR32_T
  #define BOOST_NO_CXX11_CONSTEXPR
  #define BOOST_NO_CXX11_DECLTYPE
  #define BOOST_NO_CXX11_DECLTYPE_N3276
  #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  #define BOOST_NO_CXX11_DELETED_FUNCTIONS
  #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
  #define BOOST_NO_CXX11_FINAL
  #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  #define BOOST_NO_CXX11_LAMBDAS
  #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  #define BOOST_NO_CXX11_NOEXCEPT
  #define BOOST_NO_CXX11_NULLPTR
  #define BOOST_NO_CXX11_RANGE_BASED_FOR
  #define BOOST_NO_CXX11_RAW_LITERALS
  #define BOOST_NO_CXX11_REF_QUALIFIERS
  #define BOOST_NO_CXX11_RVALUE_REFERENCES
  #define BOOST_NO_CXX11_SCOPED_ENUMS
  #define BOOST_NO_CXX11_STATIC_ASSERT
  #define BOOST_NO_CXX11_TEMPLATE_ALIASES
  #define BOOST_NO_CXX11_UNICODE_LITERALS
  #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
  #define BOOST_NO_CXX11_VARIADIC_MACROS
  #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  #define BOOST_NO_SFINAE_EXPR
  #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  </code></pre>
  
  <p>Some errors returned by compiler:</p>
  
  <pre><code>"boost/optional/optional.hpp", line 1047: Error:  #312: no suitable user-defined conversion from "boost::bad_optional_access" to "const std::exception" exists
              throw_exception(bad_optional_access());
                              ^
  
  "boost/property_tree/string_path.hpp", line 221: Error:  #312: no suitable user-defined conversion from "boost::property_tree::ptree_bad_path" to "const std::exception" exists
            BOOST_PROPERTY_TREE_THROW(ptree_bad_path("Path syntax error", *this));
            ^
  
  "boost/property_tree/detail/ptree_implementation.hpp", line 78: Error:  #742: namespace "boost" has no actual member "iterator_core_access"
            friend class boost::iterator_core_access;
                                ^
  </code></pre>
  
  <p>PS: I'm not using a widely-available standard compiler, but it's successfully compiling the <code>boost::smart_ptr</code>, using the same process described above.</p>