Skip to content
Snippets Groups Projects
Commit fb4be5df authored by Oliver Sander's avatar Oliver Sander
Browse files

minor doc improvement

[[Imported from SVN: r3678]]
parent d4a042b2
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,11 @@
#ifndef DUNE_COMMON_HELPERTEMPLATES
#define DUNE_COMMON_HELPERTEMPLATES
/*
Compile-time constraint checks from the Stroustrup FAQ
/** \file
\brief Compile-time constraint checks from the Stroustrup FAQ
*/
/*
/**
Derived_from<A,B>();
or
......@@ -23,23 +23,25 @@ template<class T, class B> struct Derived_from {
Derived_from() { void (*p)(T*) = constraints; }
};
/** \todo Please doc me! */
template<class T1, class T2> struct Can_copy {
static void constraints(T1 a, T2 b) { T2 c = a; b = a; }
Can_copy() { void (*p)(T1,T2) = constraints; }
};
/** \todo Please doc me! */
template<class T1, class T2 = T1> struct Can_compare {
static void constraints(T1 a, T2 b) { a==b; a!=b; a<b; }
Can_compare() { void (*p)(T1,T2) = constraints; }
};
/** \todo Please doc me! */
template<class T1, class T2, class T3 = T1> struct Can_multiply {
static void constraints(T1 a, T2 b, T3 c) { c = a*b; }
Can_multiply() { void (*p)(T1,T2,T3) = constraints; }
};
/*
helper template so that compilation fails if condition is not true
/** \brief Helper template so that compilation fails if condition is not true
*/
template <bool condition>
struct IsTrue
......@@ -47,6 +49,8 @@ struct IsTrue
static void no() {};
};
/** \brief Helper template so that compilation fails if condition is not true
*/
template <>
struct IsTrue<true>
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment