nvmd/libkdtree

issue mac os x clang-600.0.56

Closed this issue · 2 comments

$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

$ make
Scanning dependencies of target test_find_within_range
[ 33%] Building CXX object examples/CMakeFiles/test_find_within_range.dir/test_find_within_range.cpp.o
Linking CXX executable test_find_within_range
[ 33%] Built target test_find_within_range
Scanning dependencies of target test_hayne
[ 66%] Building CXX object examples/CMakeFiles/test_hayne.dir/test_hayne.cpp.o
Linking CXX executable test_hayne
[ 66%] Built target test_hayne
Scanning dependencies of target test_kdtree
[100%] Building CXX object examples/CMakeFiles/test_kdtree.dir/test_kdtree.cpp.o
/libkdtree/examples/test_kdtree.cpp:29:29: warning: expression result unused [-Wunused-value]
registered.insert(this).second;
~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/libkdtree/examples/test_kdtree.cpp:39:29: warning: expression result unused [-Wunused-value]
registered.insert(this).second;
~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
In file included from /libkdtree/examples/test_kdtree.cpp:6:
/libkdtree/kdtree++/kdtree.hpp:126:34: error: no matching constructor for initialization of
'std::__1::pointer_to_binary_function<triplet, unsigned long, double>'
KDTree(_Acc const& __acc = _Acc(), _Dist const& __dist = _Dist(),
^
/libkdtree/examples/test_kdtree.cpp:231:13: note: in instantiation of default function argument expression for 'KDTree<3,
triplet, std::__1::pointer_to_binary_function<triplet, unsigned long, double>, KDTree::squared_difference<double, double>, std::__1::less,
std::__1::allocatorKDTree::_Node >' required here
tree_type assigned;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1052:40: note: candidate constructor not
viable: requires single argument '__f', but no arguments were provided
_LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1047:29: note: candidate constructor
(the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
class _LIBCPP_TYPE_VIS_ONLY pointer_to_binary_function

I met the same problem in windows and I solve this problem by replacing

tree_type assigned;
 assigned = src;

with

tree_type assigned = src;

The reason for this problem is that there is no default constructor of tree_type

nvmd commented

Fixed in 4e9f2a2