« first day (2528 days earlier)      last day (877 days later) » 

2:35 AM
12
Q: Cannot use pointer to public member function that comes from a private base

antonppConsider this code: class Base { public: int foo(int x) const { return 2*x; } }; class Derived : Base { public: using Base::foo; }; Now Derived has a public method foo and it can be called Derived d; d.foo(2); // compiles (as it should) However, I cannot do anything if I use the method...

 
3:18 AM
14
Q: Why can't a const mutable lambda with an auto& parameter be invoked?

xmllmx#include <type_traits> int main() { auto f1 = [](auto&) mutable {}; static_assert(std::is_invocable_v<decltype(f1), int&>); // ok auto const f2 = [](auto&) {}; static_assert(std::is_invocable_v<decltype(f2), int&>); // ok auto const f3 = [](auto&) mutable {}; static_ass...

 

« first day (2528 days earlier)      last day (877 days later) »