@@ -828,7 +828,9 @@ class slist_impl
828828 BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT (!safemode_or_autounlink || node_algorithms::inited (n));
829829 node_ptr prev_n (prev_p.pointed_node ());
830830 node_algorithms::link_after (prev_n, n);
831- if (cache_last && (this ->get_last_node () == prev_n)){
831+
832+ BOOST_IF_CONSTEXPR (cache_last)
833+ if (this ->get_last_node () == prev_n){
832834 this ->set_last_node (n);
833835 }
834836 this ->priv_size_traits ().increment ();
@@ -860,7 +862,8 @@ class slist_impl
860862 prev_n = n;
861863 }
862864 // Now fix special cases if needed
863- if (cache_last && (this ->get_last_node () == prev_p.pointed_node ())){
865+ BOOST_IF_CONSTEXPR (cache_last)
866+ if (this ->get_last_node () == prev_p.pointed_node ()){
864867 this ->set_last_node (prev_n);
865868 }
866869 BOOST_IF_CONSTEXPR (constant_time_size){
@@ -1056,7 +1059,9 @@ class slist_impl
10561059 ++it;
10571060 node_ptr prev_n (prev.pointed_node ());
10581061 node_algorithms::unlink_after (prev_n);
1059- if (cache_last && (to_erase == this ->get_last_node ())){
1062+
1063+ BOOST_IF_CONSTEXPR (cache_last)
1064+ if (to_erase == this ->get_last_node ()){
10601065 this ->set_last_node (prev_n);
10611066 }
10621067 BOOST_IF_CONSTEXPR (safemode_or_autounlink)
@@ -1143,7 +1148,9 @@ class slist_impl
11431148 disposer (priv_value_traits ().to_value_ptr (to_erase));
11441149 this ->priv_size_traits ().decrement ();
11451150 }
1146- if (cache_last && (node_traits::get_next (bfp) == this ->get_end_node ())){
1151+
1152+ BOOST_IF_CONSTEXPR (cache_last)
1153+ if (node_traits::get_next (bfp) == this ->get_end_node ()){
11471154 this ->set_last_node (bfp);
11481155 }
11491156 return l.unconst ();
@@ -1584,7 +1591,8 @@ class slist_impl
15841591 // ! <b>Note</b>: Iterators and references are not invalidated
15851592 void reverse () BOOST_NOEXCEPT
15861593 {
1587- if (cache_last && !this ->empty ()){
1594+ BOOST_IF_CONSTEXPR (cache_last)
1595+ if (!this ->empty ()){
15881596 this ->set_last_node (node_traits::get_next (this ->get_root_node ()));
15891597 }
15901598 this ->priv_reverse (detail::bool_<linear>());
@@ -1984,7 +1992,8 @@ class slist_impl
19841992
19851993 friend bool operator ==(const slist_impl &x, const slist_impl &y)
19861994 {
1987- if (constant_time_size && x.size () != y.size ()){
1995+ BOOST_IF_CONSTEXPR (constant_time_size)
1996+ if (x.size () != y.size ()){
19881997 return false ;
19891998 }
19901999 return ::boost::intrusive::algo_equal (x.cbegin (), x.cend (), y.cbegin (), y.cend ());
@@ -2011,7 +2020,8 @@ class slist_impl
20112020 private:
20122021 void priv_splice_after (node_ptr prev_pos_n, slist_impl &x, node_ptr before_f_n, node_ptr before_l_n)
20132022 {
2014- if (cache_last && (before_f_n != before_l_n)){
2023+ BOOST_IF_CONSTEXPR (cache_last)
2024+ if (before_f_n != before_l_n){
20152025 if (prev_pos_n == this ->get_last_node ()){
20162026 this ->set_last_node (before_l_n);
20172027 }
@@ -2045,7 +2055,10 @@ class slist_impl
20452055 void priv_shift_backwards (size_type n, detail::bool_<false >)
20462056 {
20472057 node_ptr l = node_algorithms::move_forward (this ->get_root_node (), (std::size_t )n);
2048- if (cache_last && l){
2058+ (void )l;
2059+
2060+ BOOST_IF_CONSTEXPR (cache_last)
2061+ if (l){
20492062 this ->set_last_node (l);
20502063 }
20512064 }
@@ -2066,7 +2079,10 @@ class slist_impl
20662079 void priv_shift_forward (size_type n, detail::bool_<false >)
20672080 {
20682081 node_ptr l = node_algorithms::move_backwards (this ->get_root_node (), (std::size_t )n);
2069- if (cache_last && l){
2082+ (void )l;
2083+
2084+ BOOST_IF_CONSTEXPR (cache_last)
2085+ if (l){
20702086 this ->set_last_node (l);
20712087 }
20722088 }
0 commit comments