Instigate Open Source Documentation

instigate::scripting::generic::int_to_type< t > Struct Template Reference

generates distinct type for each integer. Here is an example where it may help us: More...

#include <base.hpp>

List of all members.

Public Types

enum  { value = t }

Detailed Description

template<int t>
struct instigate::scripting::generic::int_to_type< t >

generates distinct type for each integer. Here is an example where it may help us:

 template <typename T, bool b>
 class A
 {
 private:
        void function(T*, int_to_type<true>)
        {
        }
        void function(T*, int_to_type<false>)
        {
                // implementation if b == false
                // note that here can be illegal code for b == true
                // but compilation will pass as compiler will check only the 
                // syntax
        }
 public:
        void function(T* t)
        {
                function(t, int_to_type<b>());
        }
 };

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


© Instigate CJSC, Open Source