#include <iostream>
#include <ostream>

using namespace std;


template<typename T,unsigned size>
struct Array
{
    typedef T type[size];
    mutable type data;
    Array()
    {
        cout << "Array::Array" << endl;
    }
    ~Array()
    {
        cout << "Array::~Array" << endl;
    }
};

template<typename T> inline
typename Array<T,1>::type &make_array(const T &p1,const Array<T,1> &aux=Array<T,1>())
{
    aux.data[0]=p1;
    return aux.data;
}

template<typename T> inline
typename Array<T,2>::type &make_array(const T &p1,const T &p2,const Array<T,2> &aux=Array<T,2>())
{
    aux.data[0]=p1;
    aux.data[1]=p2;
    return aux.data;
}

template<typename T> inline
typename Array<T,3>::type &make_array(const T &p1,const T &p2,const T &p3,const Array<T,3> &aux=Array<T,3>())
{
    aux.data[0]=p1;
    aux.data[1]=p2;
    aux.data[2]=p3;
    return aux.data;
}

// ...

void test_array(int (&p)[3])
{
    cout << p[0] << " " << p[1] << " " << p[2] << endl;
}

void test_ptr(int *p)
{
    cout << p[0] << " " << p[1] << " " << p[2] << endl;
}

int main(int argc,char *argv[])
{
    test_array(make_array(33,22,11));
    test_ptr(make_array(33,22,11));
    return 0;
}
