#include <iostream>
#include <initializer_list>
#include <iterator>
#include <array>
#include <vector>
#include <sstream>

struct A
{
    template < typename ITERATOR > A( ITERATOR begin, ITERATOR end )
    {
        std::cout << "A::constructor - " ;
        for( ; begin != end ; ++begin ) std::cout << *begin << ' ' ;
        std::cout << '\n' ;
    }

    template < typename T >
    A( std::initializer_list<T> range ) : A( std::begin(range), std::end(range) ) {}

    template < typename RANGE >
    A( const RANGE& range, decltype( std::begin(range) )* = nullptr )
                          : A( std::begin(range), std::end(range) ) {}
};

int main()
{
    double carray[] { 10.1, 20.2, 30.3, 40.4 } ;
    A a1(carray) ; // construct from C-array (range)

    std::array<long,5> array { { 12, 13, 14 } } ;
    A a2(array) ; // from std::array (range)

    std::vector<short> vector { 91, 92, 93 } ;
    A a3(vector) ; // from sequence container (range)

    A a4( { 1, 2, 3, 4, 5 } ) ; // from initializer list

    std::istringstream stm( "50 60 70 80" ) ;
    // from pair of iterators (
    A a5( (std::istream_iterator<int>(stm)), std::istream_iterator<int>() ) ;
}
