8000 more constness · Z80coder/datalog-cpp@5b02797 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b02797

Browse files
committed
more constness
1 parent 4bee335 commit 5b02797

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Datalog.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ bool bind(const T& a, const T& b) {
8080
}
8181

8282
template <typename T>
83-
bool bind(const T& a, Variable<T>* b) {
83+
bool bind(const T& a, Variable<T>* const b) {
8484
if (b->isBound()) {
8585
return b->value() == a;
8686
}
@@ -89,13 +89,13 @@ bool bind(const T& a, Variable<T>* b) {
8989
}
9090

9191
template <typename GROUND_TYPE, typename ... Ts, size_t... Is>
92-
bool bind(const GROUND_TYPE &fact, tuple<Ts...> &atom, index_sequence<Is...>)
92+
bool bind(const GROUND_TYPE &fact, const tuple<Ts...> &atom, index_sequence<Is...>)
9393
{
9494
return ((bind(get<Is>(fact), get<Is>(atom))) and ...);
9595
}
9696

9797
template <typename GROUND_TYPE, typename ... Ts>
98-
bool bind(const GROUND_TYPE &fact, tuple<Ts...> &atom)
98+
bool bind(const GROUND_TYPE &fact, const tuple<Ts...> &atom)
9999
{
100100
return bind(fact, atom, make_index_sequence<tuple_size<GROUND_TYPE>::value>{});
101101
}
@@ -548,7 +548,7 @@ void unbind(const typename RULE_INSTANCE_TYPE::BodyType &atoms)
548548
}
549549

550550
template <size_t I, typename RULE_INSTANCE_TYPE, typename RULE_TYPE>
551-
bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms,
551+
bool bindBodyAtomsToSlice(const typename RULE_INSTANCE_TYPE::BodyType &atoms,
552552
const typename RULE_TYPE::SliceType &slice)
553553
{
554554
auto factPtr = get<I>(slice);
@@ -565,14 +565,14 @@ bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms,
565565
}
566566

567567
template <typename RULE_INSTANCE_TYPE, typename RULE_TYPE, size_t... Is>
568-
bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms,
568+
bool bindBodyAtomsToSlice(const typename RULE_INSTANCE_TYPE::BodyType &atoms,
569569
const typename RULE_TYPE::SliceType &slice, index_sequence<Is...>)
570570
{
571571
return ((bindBodyAtomsToSlice<Is, RULE_INSTANCE_TYPE, RULE_TYPE>(atoms, slice)) and ...);
572572
}
573573

574574
template <typename RULE_INSTANCE_TYPE, typename RULE_TYPE>
575-
bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms, const typename RULE_TYPE::SliceType &slice)
575+
bool bindBodyAtomsToSlice(const typename RULE_INSTANCE_TYPE::BodyType &atoms, const typename RULE_TYPE::SliceType &slice)
576576
{
577577
// for each atom, bind with corresponding relation type in slice
578578
return bindBodyAtomsToSlice<RULE_INSTANCE_TYPE, RULE_TYPE>(atoms, slice, make_index_sequence<tuple_size<typename RULE_INSTANCE_TYPE::BodyType>::value>{});

0 commit comments

Comments
 (0)
0