Skip to content

Instantly share code, notes, and snippets.

@raghunayak
raghunayak / strategy_design_pattern.cpp
Created July 16, 2015 10:59
Shows strategy design pattern.
/*
* (c) 2015 Raghavendra Nayak, All Rights Reserved.
* www.openguru.com/
*/
#include <iostream>
#include <string>
// This abstract class provides the SortingAlgorithm interface
class SortingAlgorithms
@raghunayak
raghunayak / shared_ptr.cpp
Last active February 27, 2022 08:27
A simple shared_ptr example.
/*
* Simple implementation of shared_ptr.
* Below code is non thread safe.
*
* (c) 2015 Raghavendra Nayak, All Rights Reserved.
* http://www.openguru.com/
*/
#include <iostream>
@raghunayak
raghunayak / adapter.cpp
Created July 2, 2015 09:31
Adapter Example
/*
* (c) 2015 Raghavendra Nayak, All Rights Reserved.
* www.openguru.com/
*/
#include <iostream>
#include <string>
// Window is the abstract base for all concrete Window implementations
class Window {