![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The vector form (not shown above) allows you to pass a boolean vector which is a time saver if you use the some pattern more than once as it avoids having to create the vector from the arguments each time. If a is a boolean vector then a[0] will hold wether to include the first variable a[1] the second etc... For example: vector<bool> a; a[0] = false; a[1] = false; a[2] = true; a[3] = true; a[4] = false; query << "SELECT * FROM stock WHERE " << q.equal_list(" AND ", a); /////////// (Note: Im passing "&a" because it wants to receive a pointer to a vector. Think this is a typo in the example.) |
|
However im getting and unresolved external symbol. (...Note, "SSB" is my class) "public: class SSB_cus_equal_list<enum mysqlpp::quote_type0> __thiscall SSB::equal_list<enum mysqlpp::quote_type0>(char const *, char const *, enum mysqlpp::quote_type0, class std::vector<bool,class std::allocator<bool> > *) const" |
#3
| |||
| |||
|
|
Im trying to use the equal_list() method and passing a vector to it. such as in the example from the manual... |
|
vector<bool> a; a[0] = false; a[1] = false; a[2] = true; a[3] = true; a[4] = false; |
#4
| |||
| |||
|
|
Im trying to use the equal_list() method and passing a vector to it. such as in the example from the manual... |
|
vector<bool> a; =20 a[0] =3D false; a[1] =3D false; a[2] =3D true; a[3] =3D true; a[4] = =3D false; =20 |
#5
| |||
| |||
|
|
Anyway, here is the code I added to my custom.pl |
|
I know it was suggested that this was ment to be an internal function, |
|
An example of using it.... vector<bool> a(5, false); a[stock_weight] = true; a[stock_price] = true; query << "SELECT * FROM stock WHERE " << q.equal_list(" AND ", &a); |
![]() |
| Thread Tools | |
| Display Modes | |
| |