Closed otrempe closed 1 year ago
Sadly, std::is_copy_constructible<std::vector
There might be an easy fix if the enable_if could use a more reliable check.
Not so easy finally...
Using a workaround proposed here: https://stackoverflow.com/a/18405291
This could be fixed for vector using
template<template<typename>class test, typename T>
struct smart_test : test<T> {};
template<template<typename>class test, typename T, typename A>
struct smart_test <test, std::vector<T, A>> : smart_test < test, T> {};
template<typename T>
using smart_is_copy_constructible = smart_test < std::is_copy_constructible, T >;
There is no generic solution and other containers should be added as needed to the smart_test trait. Just having it working for vectors only is already a huge step up.
I might convert this into a pull request.
I wasn't aware of the issue, thanks for the fix. I agree with you, having the issue partially fixed is better than not fixing it at all.
Fixed by #298 in FakeIt 2.3.1.
yields a compiler error where the copy constructor of unique_ptr is invoked in
MockImpl::MethodMockingContextImpl::getOriginalMethodCopyArgsInternal(int)