Skip to content

Commit 1a0bbe0

Browse files
committed
Add __declspec(novtable) for memory_resource in MSVC compilers to slightly optimize code generation (just like MS STL does)
1 parent 03d4f4f commit 1a0bbe0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/boost/container/detail/workaround.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,10 @@ namespace boost {
246246
# define BOOST_CONTAINER_CONCEPTS_BASED_OVERLOADING
247247
#endif
248248

249+
#ifdef _MSC_VER
250+
#define BOOST_CONTAINER_NOVTABLE __declspec(novtable)
251+
#else
252+
#define BOOST_CONTAINER_NOVTABLE
253+
#endif
254+
249255
#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP

include/boost/container/pmr/memory_resource.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace pmr {
2828

2929
//! The memory_resource class is an abstract interface to an
3030
//! unbounded set of classes encapsulating memory resources.
31-
class memory_resource
31+
class BOOST_CONTAINER_NOVTABLE memory_resource
3232
{
3333
public:
3434
// For exposition only

0 commit comments

Comments
 (0)