Skip to content

Commit a8d35ce

Browse files
committed
Updates to ExprTk
1 parent 8b939c0 commit a8d35ce

File tree

1 file changed

+58
-74
lines changed

1 file changed

+58
-74
lines changed

exprtk/exprtk.hpp

Lines changed: 58 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,7 @@ namespace exprtk
28482848

28492849
private:
28502850

2851-
std::size_t stride_;
2851+
const std::size_t stride_;
28522852
};
28532853

28542854
class token_modifier : public helper_interface
@@ -2953,7 +2953,7 @@ namespace exprtk
29532953

29542954
private:
29552955

2956-
std::size_t stride_;
2956+
const std::size_t stride_;
29572957
};
29582958

29592959
class token_joiner : public helper_interface
@@ -3034,7 +3034,7 @@ namespace exprtk
30343034
return changes;
30353035
}
30363036

3037-
std::size_t stride_;
3037+
const std::size_t stride_;
30383038
};
30393039

30403040
namespace helper
@@ -4039,7 +4039,7 @@ namespace exprtk
40394039

40404040
private:
40414041

4042-
std::size_t size_;
4042+
const std::size_t size_;
40434043
data_ptr_t data_;
40444044
std::vector<data_ptr_t*> data_ref_;
40454045
};
@@ -5411,7 +5411,7 @@ namespace exprtk
54115411
private:
54125412

54135413
expression_ptr branch_;
5414-
bool branch_deletable_;
5414+
const bool branch_deletable_;
54155415
bool equality_;
54165416
};
54175417

@@ -5933,9 +5933,9 @@ namespace exprtk
59335933
expression_ptr test_;
59345934
expression_ptr consequent_;
59355935
expression_ptr alternative_;
5936-
bool test_deletable_;
5937-
bool consequent_deletable_;
5938-
bool alternative_deletable_;
5936+
const bool test_deletable_;
5937+
const bool consequent_deletable_;
5938+
const bool alternative_deletable_;
59395939
};
59405940

59415941
template <typename T>
@@ -5977,8 +5977,8 @@ namespace exprtk
59775977

59785978
expression_ptr test_;
59795979
expression_ptr consequent_;
5980-
bool test_deletable_;
5981-
bool consequent_deletable_;
5980+
const bool test_deletable_;
5981+
const bool consequent_deletable_;
59825982
};
59835983

59845984
#ifndef exprtk_disable_break_continue
@@ -6033,7 +6033,7 @@ namespace exprtk
60336033
private:
60346034

60356035
expression_ptr return_;
6036-
bool return_deletable_;
6036+
const bool return_deletable_;
60376037
};
60386038

60396039
template <typename T>
@@ -6104,8 +6104,8 @@ namespace exprtk
61046104

61056105
expression_ptr condition_;
61066106
expression_ptr loop_body_;
6107-
bool condition_deletable_;
6108-
bool loop_body_deletable_;
6107+
const bool condition_deletable_;
6108+
const bool loop_body_deletable_;
61096109
};
61106110

61116111
template <typename T>
@@ -6157,8 +6157,8 @@ namespace exprtk
61576157

61586158
expression_ptr condition_;
61596159
expression_ptr loop_body_;
6160-
bool condition_deletable_;
6161-
bool loop_body_deletable_;
6160+
const bool condition_deletable_;
6161+
const bool loop_body_deletable_;
61626162
};
61636163

61646164
template <typename T>
@@ -6238,14 +6238,14 @@ namespace exprtk
62386238

62396239
private:
62406240

6241-
expression_ptr initialiser_;
6242-
expression_ptr condition_ ;
6243-
expression_ptr incrementor_;
6244-
expression_ptr loop_body_ ;
6245-
bool initialiser_deletable_;
6246-
bool condition_deletable_ ;
6247-
bool incrementor_deletable_;
6248-
bool loop_body_deletable_ ;
6241+
expression_ptr initialiser_ ;
6242+
expression_ptr condition_ ;
6243+
expression_ptr incrementor_ ;
6244+
expression_ptr loop_body_ ;
6245+
const bool initialiser_deletable_;
6246+
const bool condition_deletable_ ;
6247+
const bool incrementor_deletable_;
6248+
const bool loop_body_deletable_ ;
62496249
};
62506250

62516251
#ifndef exprtk_disable_break_continue
@@ -6306,8 +6306,8 @@ namespace exprtk
63066306

63076307
expression_ptr condition_;
63086308
expression_ptr loop_body_;
6309-
bool condition_deletable_;
6310-
bool loop_body_deletable_;
6309+
const bool condition_deletable_;
6310+
const bool loop_body_deletable_;
63116311
};
63126312

63136313
template <typename T>
@@ -6368,8 +6368,8 @@ namespace exprtk
63686368

63696369
expression_ptr condition_;
63706370
expression_ptr loop_body_;
6371-
bool condition_deletable_;
6372-
bool loop_body_deletable_;
6371+
const bool condition_deletable_;
6372+
const bool loop_body_deletable_;
63736373
};
63746374

63756375
template <typename T>
@@ -6472,10 +6472,10 @@ namespace exprtk
64726472
expression_ptr condition_ ;
64736473
expression_ptr incrementor_;
64746474
expression_ptr loop_body_ ;
6475-
bool initialiser_deletable_;
6476-
bool condition_deletable_ ;
6477-
bool incrementor_deletable_;
6478-
bool loop_body_deletable_ ;
6475+
const bool initialiser_deletable_;
6476+
const bool condition_deletable_ ;
6477+
const bool incrementor_deletable_;
6478+
const bool loop_body_deletable_ ;
64796479
};
64806480
#endif
64816481

@@ -6679,23 +6679,13 @@ namespace exprtk
66796679
static T null_value;
66806680

66816681
explicit variable_node()
6682-
: value_(&null_value),
6683-
delete_value_(false)
6682+
: value_(&null_value)
66846683
{}
66856684

66866685
variable_node(T& v)
6687-
: value_(&v),
6688-
delete_value_(false)
6686+
: value_(&v)
66896687
{}
66906688

6691-
~variable_node()
6692-
{
6693-
if (delete_value_)
6694-
{
6695-
delete value_;
6696-
}
6697-
}
6698-
66996689
inline bool operator <(const variable_node<T>& v) const
67006690
{
67016691
return this < (&v);
@@ -6721,15 +6711,9 @@ namespace exprtk
67216711
return expression_node<T>::e_variable;
67226712
}
67236713

6724-
inline bool& delete_value()
6725-
{
6726-
return delete_value_;
6727-
}
6728-
67296714
private:
67306715

67316716
T* value_;
6732-
bool delete_value_;
67336717
};
67346718

67356719
template <typename T>
@@ -7036,7 +7020,7 @@ namespace exprtk
70367020
expression_ptr index_;
70377021
vector_holder_ptr vec_holder_;
70387022
T* vector_base_;
7039-
bool index_deletable_;
7023+
const bool index_deletable_;
70407024
};
70417025

70427026
template <typename T>
@@ -7095,7 +7079,7 @@ namespace exprtk
70957079
private:
70967080

70977081
expression_ptr index_;
7098-
bool index_deletable_;
7082+
const bool index_deletable_;
70997083
vector_holder_ptr vector_holder_;
71007084
vds_t vds_;
71017085
};
@@ -7146,7 +7130,7 @@ namespace exprtk
71467130

71477131
private:
71487132

7149-
std::size_t index_;
7133+
const std::size_t index_;
71507134
vector_holder_ptr vector_holder_;
71517135
vds_t vds_;
71527136
};
@@ -7752,14 +7736,14 @@ namespace exprtk
77527736

77537737
private:
77547738

7755-
bool initialised_;
7756-
expression_ptr branch_;
7757-
bool branch_deletable_;
7758-
str_base_ptr str_base_ptr_;
7759-
irange_ptr str_range_ptr_;
7760-
mutable range_t base_range_;
7761-
mutable range_t range_;
7762-
mutable std::string value_;
7739+
bool initialised_;
7740+
expression_ptr branch_;
7741+
const bool branch_deletable_;
7742+
str_base_ptr str_base_ptr_;
7743+
irange_ptr str_range_ptr_;
7744+
mutable range_t base_range_;
7745+
mutable range_t range_;
7746+
mutable std::string value_;
77637747
};
77647748

77657749
template <typename T>
@@ -8220,9 +8204,9 @@ namespace exprtk
82208204

82218205
private:
82228206

8223-
expression_ptr branch_;
8224-
bool branch_deletable_;
8225-
str_base_ptr str_base_ptr_;
8207+
expression_ptr branch_;
8208+
const bool branch_deletable_;
8209+
str_base_ptr str_base_ptr_;
82268210
};
82278211

82288212
struct asn_assignment
@@ -9392,8 +9376,8 @@ namespace exprtk
93929376
private:
93939377

93949378
vector_interface<T>* ivec_ptr_;
9395-
expression_ptr v_;
9396-
bool v_deletable_;
9379+
expression_ptr v_;
9380+
const bool v_deletable_;
93979381
};
93989382

93999383
template <typename T>
@@ -11205,9 +11189,9 @@ namespace exprtk
1120511189

1120611190
private:
1120711191

11208-
ifunction* function_;
11192+
ifunction* function_;
1120911193
std::size_t parameter_count_;
11210-
branch_t branch_[N];
11194+
branch_t branch_[N];
1121111195
};
1121211196

1121311197
template <typename T, typename IFunction>
@@ -11494,9 +11478,9 @@ namespace exprtk
1149411478
private:
1149511479

1149611480
std::vector<expression_ptr> arg_list_;
11497-
std::vector<branch_t> branch_;
11498-
mutable tmp_vs_t expr_as_vec1_store_;
11499-
mutable range_list_t range_list_;
11481+
std::vector<branch_t> branch_;
11482+
mutable tmp_vs_t expr_as_vec1_store_;
11483+
mutable range_list_t range_list_;
1150011484
};
1150111485

1150211486
#ifndef exprtk_disable_string_capabilities
@@ -11675,7 +11659,7 @@ namespace exprtk
1167511659

1167611660
private:
1167711661

11678-
std::size_t param_seq_index_;
11662+
const std::size_t param_seq_index_;
1167911663
};
1168011664
#endif
1168111665

@@ -11798,7 +11782,7 @@ namespace exprtk
1179811782
results_context_t* results_context_;
1179911783
mutable bool return_invoked_;
1180011784
expression_ptr body_;
11801-
bool body_deletable_;
11785+
const bool body_deletable_;
1180211786
};
1180311787
#endif
1180411788

@@ -14527,7 +14511,7 @@ namespace exprtk
1452714511
cob_node(const cob_node<T,Operation>&);
1452814512
cob_node<T,Operation>& operator=(const cob_node<T,Operation>&);
1452914513

14530-
const T c_;
14514+
const T c_;
1453114515
branch_t branch_[1];
1453214516
};
1453314517

@@ -14588,7 +14572,7 @@ namespace exprtk
1458814572
boc_node(const boc_node<T,Operation>&);
1458914573
boc_node<T,Operation>& operator=(const boc_node<T,Operation>&);
1459014574

14591-
const T c_;
14575+
const T c_;
1459214576
branch_t branch_[1];
1459314577
};
1459414578

0 commit comments

Comments
 (0)