Changed the constness of interactive_t::get<T>
This commit is contained in:
parent
49d79045a5
commit
1406cbe853
1 changed files with 22 additions and 8 deletions
|
|
@ -78,39 +78,53 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const value_t& value_at(std::size_t index) const {
|
value_t& value_at(std::size_t index) {
|
||||||
assert(has(index));
|
assert(has(index));
|
||||||
return args[index];
|
return args[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T get(std::size_t index) const;
|
T get(std::size_t index);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline bool interactive_t::get<bool>(std::size_t index) const {
|
inline bool interactive_t::get<bool>(std::size_t index) {
|
||||||
return value_at(index).to_boolean();
|
return value_at(index).to_boolean();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline long interactive_t::get<long>(std::size_t index) const {
|
inline long interactive_t::get<long>(std::size_t index) {
|
||||||
return value_at(index).to_long();
|
return value_at(index).to_long();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline string interactive_t::get<string>(std::size_t index) const {
|
inline amount_t interactive_t::get<amount_t>(std::size_t index) {
|
||||||
|
return value_at(index).to_amount();
|
||||||
|
}
|
||||||
|
template <>
|
||||||
|
inline string interactive_t::get<string>(std::size_t index) {
|
||||||
return value_at(index).to_string();
|
return value_at(index).to_string();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline mask_t interactive_t::get<mask_t>(std::size_t index) const {
|
inline mask_t interactive_t::get<mask_t>(std::size_t index) {
|
||||||
return value_at(index).to_mask();
|
return value_at(index).to_mask();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline date_t interactive_t::get<date_t>(std::size_t index) const {
|
inline date_t interactive_t::get<date_t>(std::size_t index) {
|
||||||
return value_at(index).to_date();
|
return value_at(index).to_date();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline datetime_t interactive_t::get<datetime_t>(std::size_t index) const {
|
inline datetime_t interactive_t::get<datetime_t>(std::size_t index) {
|
||||||
return value_at(index).to_datetime();
|
return value_at(index).to_datetime();
|
||||||
}
|
}
|
||||||
|
template <>
|
||||||
|
inline value_t::sequence_t&
|
||||||
|
interactive_t::get<value_t::sequence_t&>(std::size_t index) {
|
||||||
|
return value_at(index).as_sequence_lval();
|
||||||
|
}
|
||||||
|
template <>
|
||||||
|
inline const value_t::sequence_t&
|
||||||
|
interactive_t::get<const value_t::sequence_t&>(std::size_t index) {
|
||||||
|
return value_at(index).as_sequence();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class in_context_t : public interactive_t
|
class in_context_t : public interactive_t
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue