No you can’t.
The protected accessor on a method means that only the following can access it:
- the class itself
- class that inherits from it
- another class with friendship
https://en.cppreference.com/w/cpp/language/access#Protected_member_access
More Related Contents:
- How to set up unit testing for Visual Studio C++
- How do I iterate over a Constant Vector?
- Are there types bigger than long long int in C++?
- Is ‘bool’ a basic datatype in C++?
- C++ Linker Error With Class static constexpr
- Checking if two cubic Bézier curves intersect
- Are global variables in C++ stored on the stack, heap or neither of them?
- Should I include stddef.h or cstddef for size_t
- Function stoi not declared
- Modifying reference member from const member function in C++
- LRU implementation in production code
- Spurious warning about binding temporary to reference member in constructor
- Initializing an object to all zeroes
- Dynamic menu using mfc
- OpenAL: How to create simple “Microphone Echo” programm?
- What Rules does compiler have to follow when dealing with volatile memory locations?
- Undocumented GCC Extension: VLA in struct
- How can I use a std::valarray to store/manipulate a contiguous 2D array?
- STL map containing references does not compile
- What is std::move(), and when should it be used and does it actually move anything?
- MD5 hash from file in C++
- Is returning references of member variables bad practice?
- Use-cases of pure virtual functions with body?
- C++ – value of uninitialized vector
- Is there a way to write a large number in C++ source code with spaces to make it more readable? [duplicate]
- Linux C++: how to profile time wasted due to cache misses?
- C++ template typename iterator
- std::async won’t spawn a new thread when return value is not stored
- Overload resolution with std::function
- How to tell if a type is an instance of a specific template class?