Added examples to cmake building process.

Set /WX flas that is warnings as errors on MSVC build.
Updated linux, osx, msvc build to refer to appropriate boost libraries.
This commit is contained in:
Takatoshi Kondo
2015-08-12 12:53:56 +09:00
parent e50cc5d79f
commit 12b5a6235a
15 changed files with 284 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ template <typename T, std::size_t level>
struct vecvec {
typedef std::vector<typename vecvec<T, level - 1>::type> type;
static void fill(type& v, std::size_t num_of_elems, T const& val) {
for (int elem = 0; elem < num_of_elems; ++elem) {
for (std::size_t elem = 0; elem < num_of_elems; ++elem) {
typename vecvec<T, level - 1>::type child;
vecvec<T, level - 1>::fill(child, num_of_elems, val);
v.push_back(child);
@@ -41,7 +41,7 @@ template <typename T>
struct vecvec<T, 0> {
typedef std::vector<T> type;
static void fill(type& v, std::size_t num_of_elems, T const& val) {
for (int elem = 0; elem < num_of_elems; ++elem) {
for (std::size_t elem = 0; elem < num_of_elems; ++elem) {
v.push_back(val);
}
}
@@ -50,9 +50,9 @@ struct vecvec<T, 0> {
void test_array_of_array() {
std::cout << "[TEST][array_of_array]" << std::endl;
// setup
int const depth = 16;
int const depth = 4;
std::cout << "Setting up array data..." << std::endl;
typename vecvec<int, depth>::type v1;
vecvec<int, depth>::type v1;
vecvec<int, depth>::fill(v1, 3, 42);
std::cout << "Start packing..." << std::endl;
@@ -77,7 +77,7 @@ void test_array_of_array() {
std::cout << result << std::endl;
}
std::cout << "Unpack finished..." << std::endl;
typename vecvec<int, depth>::type v2;
vecvec<int, depth>::type v2;
std::cout << "Start converting..." << std::endl;
{
boost::timer::cpu_timer timer;