This project is read-only.

Compiling & running CppLinqTests.hpp under OS/X / clang


Finally. LINQ for C++. Love your package.

Some FYI.

In order to get CppLinqTests.hpp to compile under the latest version of OS/X (+clang) the following needs to be added to CppLinqTests.hpp ...
#ifdef __APPLE__
#include <cmath>
...else you get...
./CppLinqTests.hpp:3032:27: error: no member named 'ceil' in namespace 'std'
       auto r = std::ceil (std::sqrt (i));
./CppLinqTests.hpp:3032:38: error: no member named 'sqrt' in namespace 'std'
       auto r = std::ceil (std::sqrt (i));

After including <cmath> clang produces 2 warnings.....
./CppLinqTests.hpp:455:16: warning: explicitly moving variable of type 'opt<int>' to itself
       o1 = std::move (o1);
       ~~ ^            ~~
./CppLinqTests.hpp:456:16: warning: explicitly moving variable of type 'opt<int>' to itself
       o2 = std::move (o2);
       ~~ ^            ~~
2 warnings generated.
Running the tests yields .....
./cpplinq.clang++ p

CppLinq test program

Command line options:
f - run functional tests (default)
p - run functional + performance tests
Starting functional + performance tests...
./CppLinqTests.hpp(431): RUNNING: test_opt
./CppLinqTests.hpp(526): RUNNING: test_lookup
./CppLinqTests.hpp(642): RUNNING: test_from
./CppLinqTests.hpp(740): RUNNING: test_range
./CppLinqTests.hpp(785): RUNNING: test_repeat
./CppLinqTests.hpp(848): RUNNING: test_empty
./CppLinqTests.hpp(883): RUNNING: test_singleton
./CppLinqTests.hpp(896): RUNNING: test_generate
./CppLinqTests.hpp(925): RUNNING: test_set
./CppLinqTests.hpp(968): RUNNING: test_count
./CppLinqTests.hpp(996): RUNNING: test_any
./CppLinqTests.hpp(1023): RUNNING: test_first
./CppLinqTests.hpp(1084): RUNNING: test_first_or_default
./CppLinqTests.hpp(1112): RUNNING: test_last_or_default
./CppLinqTests.hpp(1139): RUNNING: test_sum
./CppLinqTests.hpp(1211): RUNNING: test_avg
./CppLinqTests.hpp(1243): RUNNING: test_max
./CppLinqTests.hpp(1174): RUNNING: test_min
./CppLinqTests.hpp(1281): RUNNING: test_concatenate
./CppLinqTests.hpp(1327): RUNNING: test_all
./CppLinqTests.hpp(1307): RUNNING: test_for_each
./CppLinqTests.hpp(1357): RUNNING: test_to_vector
./CppLinqTests.hpp(1378): RUNNING: test_to_map
./CppLinqTests.hpp(1418): RUNNING: test_to_lookup
./CppLinqTests.hpp(1500): RUNNING: test_to_list
./CppLinqTests.hpp(1524): RUNNING: test_container
./CppLinqTests.hpp(1565): RUNNING: test_where
./CppLinqTests.hpp(1587): RUNNING: test_ref
./CppLinqTests.hpp(1624): RUNNING: test_select
./CppLinqTests.hpp(1742): RUNNING: test_select_many
./CppLinqTests.hpp(1658): RUNNING: test_join
./CppLinqTests.hpp(1788): RUNNING: test_orderby
./CppLinqTests.hpp(1938): RUNNING: test_reverse
./CppLinqTests.hpp(2048): RUNNING: test_take
./CppLinqTests.hpp(1979): RUNNING: test_skip
./CppLinqTests.hpp(2084): RUNNING: test_take_while
./CppLinqTests.hpp(2018): RUNNING: test_skip_while
./CppLinqTests.hpp(2123): RUNNING: test_contains
./CppLinqTests.hpp(2170): RUNNING: test_element_at_or_default
./CppLinqTests.hpp(2208): RUNNING: test_aggregate
./CppLinqTests.hpp(2249): RUNNING: test_distinct
./CppLinqTests.hpp(2281): RUNNING: test_union_with
./CppLinqTests.hpp(2362): RUNNING: test_intersect_with
./CppLinqTests.hpp(2453): RUNNING: test_except
./CppLinqTests.hpp(2549): RUNNING: test_concat
./CppLinqTests.hpp(2632): RUNNING: test_sequence_equal
./CppLinqTests.hpp(2764): RUNNING: test_pairwise
./CppLinqTests.hpp(2803): RUNNING: test_zip_with
./CppLinqTests.hpp(2919): RUNNING: test_performance_range_sum
./CppLinqTests.hpp(2955): ERROR_EXPECTED: true(true), FOUND: false((ratio > 1/ratio_limit && ratio < ratio_limit))
Performance numbers for simple sum over numbers, expected:0, result:0, ratio_limit:3.000000, ratio:nan
./CppLinqTests.hpp(2969): RUNNING: test_performance_sum
Performance numbers for simple sum over numbers, expected:175, result:168, ratio_limit:2.000000, ratio:1.041667
./CppLinqTests.hpp(3053): RUNNING: test_performance_is_prime
Performance numbers for computing primes, expected:1217, result:1200, ratio_limit:1.250000, ratio:1.014167
Functional + performance tests finished
Tests failed, reporting 101
The O/S is
Darwin MALON.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
And clang is
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
Thanks for your cool package.

Harry Reed