Add example of bridge pattern in C++
This commit is contained in:
10
cpp/patterns/bridge/abstraction.cpp
Normal file
10
cpp/patterns/bridge/abstraction.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
#include "abstraction.hpp"
|
||||
|
||||
int VerboseCalculator::doMath(const int &a, const int &b) const
|
||||
{
|
||||
int result = method->math(a, b);
|
||||
std::cout << "Performing " << method->getName() << " on input: a = " << a
|
||||
<< ", b = " << b << std::endl << "Result: " << result << std::endl;
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user