2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-18 10:25:12 +00:00
qpdf/libtests/obj_table.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
672 B
C++
Raw Normal View History

#include <qpdf/ObjTable.hh>
struct Test
{
int value{0};
};
class Table: public ObjTable<Test>
{
public:
Table()
{
initialize(5);
}
void
test()
{
for (int i = 0; i < 10; ++i) {
(*this)[i].value = 2 * i;
(*this)[1000 + i].value = 2 * (1000 + i);
}
forEach([](auto i, auto const& item) -> void {
std::cout << std::to_string(i) << " : " << std::to_string(item.value) << "\n";
});
std::cout << "2000 : " << std::to_string((*this)[2000].value) << "\n";
}
};
int
main()
{
Table().test();
std::cout << "object table tests done\n";
return 0;
}