News for hackers. Stuff that matters.
Re:BASIC in C++ by thought_alarm on Saturday June 20, 2015 @06:57PM (#9751328)

    ] 10 PRINT "HELLO'

    ] RUN

    ERROR
    In file included from dummy.cpp:1:
    In file included from /usr/include/c++/v1/vector:243:
    In file included from /usr/include/c++/v1/__bit_reference:15:
    In file included from /usr/include/c++/v1/algorithm:594:
    /usr/include/c++/v1/memory:1425:36: error: calling a private constructor of class 'std::__1::unique_ptr<int,
    std::__1::default_delete<int> >'
    ::new ((void*)__p) _Tp(_STD::forward<_Args>(__args)...);
    ^
    /usr/include/c++/v1/memory:1358:14: note: in instantiation of function template specialization
    'std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<int, std::__1::default_delete<int> > >
    >::__construct<std::__1::unique_ptr<int, std::__1::default_delete<int> >, std::__1::unique_ptr<int,
    std::__1::default_delete<int> > &>' requested here
    {__construct(__has_construct<allocator_type, pointer, _Args...>(),
    ^
    /usr/include/c++/v1/vector:781:25: note: in instantiation of function template specialization
    'std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<int, std::__1::default_delete<int> > >
    >::construct<std::__1::unique_ptr<int, std::__1::default_delete<int> >, std::__1::unique_ptr<int,
    std::__1::default_delete<int> > &>' requested here
    __alloc_traits::construct(__a, _STD::__to_raw_pointer(this->__end_), *__first);
    ^
    /usr/include/c++/v1/vector:924:9: note: in instantiation of function template specialization
    'std::__1::vector<std::__1::unique_ptr<int, std::__1::default_delete<int> >,
    std::__1::allocator<std::__1::unique_ptr<int, std::__1::default_delete<int> > >
    >::__construct_at_end<std::__1::unique_ptr<int, std::__1::default_delete<int> > *>' requested here
    __construct_at_end(__x.__begin_, __x.__end_);
    ^
    dummy.cpp:7:37: note: in instantiation of member function 'std::__1::vector<std::__1::unique_ptr<int,
    std::__1::default_delete<int> >, std::__1::allocator<std::__1::unique_ptr<int, std::__1::default_delete<int> > >
    >::vector' requested here
    std::vector<unique_ptr<int>> bar = foo;
    ^
    /usr/include/c++/v1/memory:1997:5: note: declared private here
    unique_ptr(const unique_ptr&);
    ^
    1 error generated.
Re:BASIC in C++ by ExpiredLink on Sunday June 21, 2015 @04:13AM (#9752653)
templates are a inappropriate macro language. Everyone knows this except the C++ aficionados.