1    	// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2    	// vim: ts=8 sw=2 smarttab
3    	
4    	#ifndef COMMON_REF_H
5    	#define COMMON_REF_H
6    	
7    	#include <boost/intrusive_ptr.hpp>
8    	
9    	namespace ceph {
10   	template<typename T> using ref_t = boost::intrusive_ptr<T>;
11   	template<typename T> using cref_t = boost::intrusive_ptr<const T>;
12   	template<class T, class U>
(1) Event exn_spec_violation: An exception of type "_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINSt8ios_base7failureB5cxx11EEEEE" is thrown but the throw list "throw()" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
Also see events: [fun_call_w_exception]
13   	ref_t<T> ref_cast(const ref_t<U>& r) noexcept {
(2) Event fun_call_w_exception: Called function throws an exception of type "_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINSt8ios_base7failureB5cxx11EEEEE". [details]
Also see events: [exn_spec_violation]
14   	  return static_cast<T*>(r.get());
15   	}
16   	template<class T, class U>
17   	ref_t<T> ref_cast(ref_t<U>&& r) noexcept {
18   	  return {static_cast<T*>(r.detach()), false};
19   	}
20   	template<class T, class U>
21   	cref_t<T> ref_cast(const cref_t<U>& r) noexcept {
22   	  return static_cast<const T*>(r.get());
23   	}
24   	template<class T, typename... Args>
25   	ceph::ref_t<T> make_ref(Args&&... args) {
26   	  return {new T(std::forward<Args>(args)...), false};
27   	}
28   	}
29   	
30   	// Friends cannot be partial specializations: https://en.cppreference.com/w/cpp/language/friend
31   	#define FRIEND_MAKE_REF(C) \
32   	template<class T, typename... Args> friend ceph::ref_t<T> ceph::make_ref(Args&&... args)
33   	
34   	#endif
35