Add cpp_namespace

This commit is contained in:
Jonathan Müller 2017-01-20 23:42:51 +01:00
commit c25103e680
9 changed files with 113 additions and 9 deletions

View file

@ -14,6 +14,11 @@ namespace cppast
struct assert_handler : debug_assert::set_level<1>, debug_assert::default_handler
{
};
struct precondition_error_handler : debug_assert::set_level<1>,
debug_assert::default_handler
{
};
}
} // namespace cppast::detail

View file

@ -29,14 +29,14 @@ namespace cppast
struct intrusive_list_access
{
template <typename U>
static T* get_next(const intrusive_list_node<U>& obj)
static T* get_next(const U& obj)
{
static_assert(std::is_base_of<U, T>::value, "must be a base");
return static_cast<T*>(obj.next_.get());
}
template <typename U>
static T* set_next(intrusive_list_node<U>& obj, std::unique_ptr<T> node)
static T* set_next(U& obj, std::unique_ptr<T> node)
{
static_assert(std::is_base_of<U, T>::value, "must be a base");
obj.next_ = std::move(node);