Category : access-control

Problem Here’s a contrived example of a problem I’m facing. I have a templated object with a map function that creates a new object and operates on private (or protected, it doesn’t matter) members within that new object. template<typename T> class Foo { public: template<typename R> Foo<R> map(std::function<R(std::optional<T>)> &&function) { auto mappedValue = function(mValue); Foo<R> ..

Read more