CameraSet::project2 SFINAE to resolve overload ambiguity

release/4.3a0
Varun Agrawal 2023-06-21 13:29:32 -04:00
parent 43a9fbf461
commit c9397c34fc
1 changed files with 6 additions and 3 deletions

View File

@ -131,12 +131,15 @@ class CameraSet : public std::vector<CAMERA, Eigen::aligned_allocator<CAMERA>> {
return z; return z;
} }
/** An overload o the project2 function to accept /** An overload of the project2 function to accept
* full matrices and vectors and pass it to the pointer * full matrices and vectors and pass it to the pointer
* version of the function * version of the function.
*
* Use SFINAE to resolve overload ambiguity.
*/ */
template <class POINT, class... OptArgs> template <class POINT, class... OptArgs>
ZVector project2(const POINT& point, OptArgs&... args) const { typename std::enable_if<(sizeof...(OptArgs) != 0), ZVector>::type project2(
const POINT& point, OptArgs&... args) const {
// pass it to the pointer version of the function // pass it to the pointer version of the function
return project2(point, (&args)...); return project2(point, (&args)...);
} }