Function volatilize

Synopsis

#include "breeze/idiom/volatilize.hpp"

template <typename T>
T volatile & volatilize(T &ref)

Description

Adds a volatile qualification to an lvalue expression, if it doesn't have one.

This allows avoiding using a const_cast or a static_cast, or introducing an additional variable.

Returns
ref

Source

Lines 32-37 in breeze/idiom/volatilize.hpp.

template< typename T >
T volatile &
volatilize( T & ref )
{
    return ref ;
}