di
di copied to clipboard
There is a conflict with boost
Expected Behavior
Boost and boost di should not have conflicts
Actual Behavior
As di.hpp defines __has_builtin the following code fails with an error error C3861: '__builtin_assume': identifier not found
#if defined( __has_builtin )
# if __has_builtin( __builtin_assume )
__builtin_assume( local_use_count_ >= 1 );
# endif
#endif
Steps to Reproduce the Problem
- Include boost
boost\smart_ptr\detail\local_counted_base.hppafterdi.hpp - Try to compile
Specifications
- Version: 1.1
- Platform: Windows
- Subsystem: msvc
@krzysztof-jusiak I think boost.di should define it's own aliases for these features
I can do this if you think it is the way to go.
Also, it is happening right into di.hpp
#if __has_include(<boost/shared_ptr.hpp>)
// clang-format on
#include <boost/shared_ptr.hpp>
#else
Temporary fixed with workaround:
#if !defined(__builtin_assume)
#define __builtin_assume(...) 0
#endif
#define __has_builtin(...) 1
#define BOOST_DI_CFG_CTOR_LIMIT_SIZE 17