Skip to content

Commit

Permalink
Making implicit templates types discoverable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Hare committed Aug 8, 2014
1 parent 4e57acf commit b35f4b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions autowiring/atomic_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ template<class object, class lock> class unlock_object;
/// or to modify the contents of atomic_object.
/// - Held locks, via child classes that manipulate the protected lock member.
///</remarks>
template<class object, class lock = std::mutex>
template<class object_type, class lock_type = std::mutex>
class atomic_object {
public:
friend class unlock_object<object, lock>;
friend class unlock_object<object_type, lock_type>;
typedef object_type object;
typedef lock_type lock;
typedef unlock_object<object, lock> unlock;
typedef std::shared_ptr<atomic_object<object, lock>> shared;

Expand Down
6 changes: 4 additions & 2 deletions autowiring/unlock_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ template<class object, class lock> class atomic_object;
///An unlock_object cannot be copied by construction or assignment since it maintains access.
///An unlock_object cannot be used to extend the existence of an atomic_object.
///</remarks>
template<class object, class lock = std::mutex>
template<class object_type, class lock_type = std::mutex>
class unlock_object {
public:
typedef atomic_object<object, lock> atomic;
typedef object_type object;
typedef atomic_object<object_type, lock_type> atomic;
typedef typename atomic::lock lock;
typedef typename atomic::shared shared;

unlock_object(const unlock_object<object, lock>& source) = delete;
Expand Down

0 comments on commit b35f4b8

Please sign in to comment.