Utils::CalitkoMocks::BoundArgumentStorageType< T & > Struct Template Reference

#include <BasicTypes.h> [code]

List of all members.


Detailed Description

template<typename T>
struct Utils::CalitkoMocks::BoundArgumentStorageType< T & >

Defines storage type for references.

This specialization is in fact not necessary (it is equivalent to the base template) but we do it in order to be able to explicitly state our position regarding the use of references in both code and documentation.

A reference type would generally be used in function argument when:

The first case would normally involve value types, which we can copy and then compare, but we don't want to because the caller would expect the side effect on the object. Reference exception verification compares identity instead of value, unless you provide your own checker object (see the checker() function) to generate the side effects. The effect is that unless you provide a checker function, your test will fail because the caller would not provide the same identity.

The second case is normally when only the identity of the object is important. The default exception verification is comparing the addresses of the expected and actual object. We can of course overwrite this behaviour by either providing a checker object (see the checker() function), or providing a specialization for IsSameValue.

In any case, we don't want to copy the object, so we store just the reference.

Definition at line 73 of file BasicTypes.h.

Public Types

typedef T & type


Member Typedef Documentation

template<typename T>
typedef T& Utils::CalitkoMocks::BoundArgumentStorageType< T & >::type
 

Definition at line 75 of file BasicTypes.h.


The documentation for this struct was generated from the following file: