-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify constexpr in GC allocators if C++20 or later
(a cherry-pick of commit 9702965 from 'master') PR #603 (bdwgc). This adds the `constexpr` attribute on each allocator member function, including ctors and dtors, to enable easier use of these allocators in compile-time execution. A practical example of this would be a modern C++ string class which supports constexpr construction, usage, and destruction. Without this change, the C++ compiler will not allow such a class. * include/gc_allocator.h (gc_allocator, traceable_allocator, gc_allocator_ignore_off_page): Declare all member functions as GC_CONSTEXPR; reformat code. * include/gc_config_macros.h [__cplusplus && !GC_CONSTEXPR] (GC_CONSTEXPR): Define macro.
- Loading branch information
Showing
2 changed files
with
79 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters