- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
template <typename type>
class some
{
type val;
public:
some( const type &a ) : val(a)
{ }
template<typename t>
some( const some<t> &a )
{
val = static_cast<type>(a.val);
}
template <typename type>
friend class some; // иначе ошибка - нет доступа к приватному члену
};
Follow us!