Add example of bridge pattern in C++

This commit is contained in:
2021-05-11 16:03:03 -04:00
parent baabfa439a
commit da9d26cf15
6 changed files with 139 additions and 0 deletions

View 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;
}