From 18d48a202ed36002228729a48ca5cda980a065f1 Mon Sep 17 00:00:00 2001 From: quantumwizard Date: Thu, 28 May 2020 22:59:08 -0700 Subject: [PATCH 1/3] Allocate member variables with custom allocator Since a custome Allocator can by provided, I think it should be used with the member std::vector variables --- include/boost/format/format_class.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/format/format_class.hpp b/include/boost/format/format_class.hpp index a7ccc29e..c8a578d5 100644 --- a/include/boost/format/format_class.hpp +++ b/include/boost/format/format_class.hpp @@ -161,8 +161,8 @@ namespace boost { void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation // member data --------------------------------------------// - std::vector items_; // each '%..' directive leads to a format_item - std::vector bound_; // stores which arguments were bound. size() == 0 || num_args + std::vector items_; // each '%..' directive leads to a format_item + std::vector bound_; // stores which arguments were bound. size() == 0 || num_args int style_; // style of format-string : positional or not, etc int cur_arg_; // keep track of wich argument is current From 92c61ac9f236754838ee6a1478d88f614933338f Mon Sep 17 00:00:00 2001 From: quantumwizard Date: Fri, 29 May 2020 09:11:28 -0700 Subject: [PATCH 2/3] rebinding allocator for vector types --- include/boost/format/format_class.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/format/format_class.hpp b/include/boost/format/format_class.hpp index c8a578d5..b3d8445d 100644 --- a/include/boost/format/format_class.hpp +++ b/include/boost/format/format_class.hpp @@ -161,8 +161,8 @@ namespace boost { void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation // member data --------------------------------------------// - std::vector items_; // each '%..' directive leads to a format_item - std::vector bound_; // stores which arguments were bound. size() == 0 || num_args + std::vector::other > items_; // each '%..' directive leads to a format_item + std::vector::other > bound_; // stores which arguments were bound. size() == 0 || num_args int style_; // style of format-string : positional or not, etc int cur_arg_; // keep track of wich argument is current From a5615013a481fff593e245a5a4d4ae61e6cc6d04 Mon Sep 17 00:00:00 2001 From: quantumwizard Date: Mon, 1 Jun 2020 13:23:02 -0700 Subject: [PATCH 3/3] using boost::allocator_rebind using boost::allocator_rebind so it will work with bost c++17 deprecation of std::allocator::rebind --- include/boost/format/format_class.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/format/format_class.hpp b/include/boost/format/format_class.hpp index b3d8445d..80f8cd9c 100644 --- a/include/boost/format/format_class.hpp +++ b/include/boost/format/format_class.hpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace boost { @@ -161,8 +162,8 @@ namespace boost { void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation // member data --------------------------------------------// - std::vector::other > items_; // each '%..' directive leads to a format_item - std::vector::other > bound_; // stores which arguments were bound. size() == 0 || num_args + std::vector::type > items_; // each '%..' directive leads to a format_item + std::vector::type > bound_; // stores which arguments were bound. size() == 0 || num_args int style_; // style of format-string : positional or not, etc int cur_arg_; // keep track of wich argument is current