template<typename Next> struct interface_add_sorted_insert : public Next { void insert(typename Next::value_type const& value) { typename Next::iterator pos = std::lower_bound(get_impl().begin(), get_impl().end(), value); get_impl().insert(pos, value); } }; template<typename Next> struct interface_add_iterators : public Next { typename Next::iterator begin() { return get_impl().begin(); } typename Next::const_iterator begin() const { return get_impl().begin(); } typename Next::reverse_iterator rbegin() { return get_impl().rbegin(); } typename Next::const_reverse_iterator rbegin() const { return get_impl().rbegin(); } typename Next::iterator end() { return get_impl().end(); } typename Next::const_iterator end() const { return get_impl().end(); } typename Next::iterator rend() { return get_impl().rend(); } typename Next::const_reverse_iterator rend() const { return get_impl().rend(); } }; template<typename Next> struct interface_add_const_iterators : public Next { typename Next::const_iterator begin() const { return get_impl().begin(); } typename Next::const_reverse_iterator rbegin() const { return get_impl().rbegin(); } typename Next::const_iterator end() const { return get_impl().end(); } typename Next::const_reverse_iterator rend() const { return get_impl().rend(); } }; template<typename Next> struct interface_add_const_metafuncs : public Next { typename Next::size_type size() const { return get_impl().size(); } typename Next::size_type capacity() const { return get_impl().capacity(); } typename Next::size_type length() const { return get_impl().length(); } bool empty() const { return get_impl().empty(); } }; template<typename Next> struct interface_add_back_front : public Next { typename Next::value_type& front() { return get_impl().front(); } typename Next::value_type const& front() const { return get_impl().front(); } typename Next::value_type& back() { return get_impl().back(); } typename Next::value_type const& back() const { return get_impl().back(); } }; template<typename Next> struct interface_add_const_back_front : public Next { typename Next::value_type const& front() const { return get_impl().front(); } typename Next::value_type const& back() const { return get_impl().back(); } }; template<typename Next> struct interface_add_random_access : public Next { typename Next::value_type& operator[](typename Next::size_type index) { return get_impl()[index]; } typename Next::value_type const& operator[](typename Next::size_type index) const { return get_impl()[index]; } }; template<typename Next> struct interface_add_const_random_access : public Next { typename Next::value_type const& operator[](typename Next::size_type index) const { return get_impl()[index]; } }; template<typename Next> struct interface_add_sequence_access : public interface_add_iterators< interface_add_back_front< interface_add_random_access< Next > > > { }; template<typename Next> struct interface_add_const_sequence_access : public interface_add_const_iterators< interface_add_const_back_front< interface_add_const_random_access< Next > > > { }; template<typename Impl> class interface_base { public: typedef typename Impl::value_type value_type; typedef typename Impl::reference reference; typedef typename Impl::const_reference const_reference; typedef typename Impl::pointer pointer; typedef typename Impl::const_pointer const_pointer; typedef typename Impl::iterator iterator; typedef typename Impl::const_iterator const_iterator; typedef typename Impl::reverse_iterator reverse_iterator; typedef typename Impl::const_reverse_iterator const_reverse_iterator; typedef typename Impl::size_type size_type; typedef typename Impl::difference_type difference_type; typedef typename Impl::allocator_type allocator_type; typedef Impl container_type; private: Impl impl; protected: Impl& get_impl() { return impl; } Impl const& get_impl() const { return impl; } public: interface_base() : impl() { } explicit interface_base(allocator_type const& allocator) : impl(allocator) { } explicit interface_base(size_type n) : impl(n) { } interface_base(size_type n, value_type const& value) : impl(n, value) { } interface_base(size_type n, value_type const& value, allocator_type const& allocator) : impl(n, value, allocator) { } interface_base(container_type const& other) : impl(other) { } interface_base(interface_base const& other) : impl(other.impl) { } template<typename InputIter> interface_base(InputIter first, InputIter last) : impl(first, last) { } template<typename InputIter> interface_base(InputIter first, InputIter last, allocator_type const& allocator) : impl(first, last, allocator) { } };
Standard input is empty
prog.cpp: In member function ‘void interface_add_sorted_insert<Next>::insert(const typename Next::value_type&)’: prog.cpp:4:33: error: ‘lower_bound’ is not a member of ‘std’ prog.cpp:4:59: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp:4:59: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) prog.cpp:4:79: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp:5:12: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::iterator interface_add_iterators<Next>::begin()’: prog.cpp:12:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_iterator interface_add_iterators<Next>::begin() const’: prog.cpp:16:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::reverse_iterator interface_add_iterators<Next>::rbegin()’: prog.cpp:20:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_reverse_iterator interface_add_iterators<Next>::rbegin() const’: prog.cpp:24:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::iterator interface_add_iterators<Next>::end()’: prog.cpp:28:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_iterator interface_add_iterators<Next>::end() const’: prog.cpp:32:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::iterator interface_add_iterators<Next>::rend()’: prog.cpp:36:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_reverse_iterator interface_add_iterators<Next>::rend() const’: prog.cpp:40:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_iterator interface_add_const_iterators<Next>::begin() const’: prog.cpp:47:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_reverse_iterator interface_add_const_iterators<Next>::rbegin() const’: prog.cpp:51:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_iterator interface_add_const_iterators<Next>::end() const’: prog.cpp:55:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::const_reverse_iterator interface_add_const_iterators<Next>::rend() const’: prog.cpp:59:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::size_type interface_add_const_metafuncs<Next>::size() const’: prog.cpp:66:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::size_type interface_add_const_metafuncs<Next>::capacity() const’: prog.cpp:69:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::size_type interface_add_const_metafuncs<Next>::length() const’: prog.cpp:72:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘bool interface_add_const_metafuncs<Next>::empty() const’: prog.cpp:75:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::value_type& interface_add_back_front<Next>::front()’: prog.cpp:82:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_back_front<Next>::front() const’: prog.cpp:86:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::value_type& interface_add_back_front<Next>::back()’: prog.cpp:90:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_back_front<Next>::back() const’: prog.cpp:94:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_const_back_front<Next>::front() const’: prog.cpp:101:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_const_back_front<Next>::back() const’: prog.cpp:105:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘typename Next::value_type& interface_add_random_access<Next>::operator[](typename Next::size_type)’: prog.cpp:112:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_random_access<Next>::operator[](typename Next::size_type) const’: prog.cpp:116:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive] prog.cpp: In member function ‘const typename Next::value_type& interface_add_const_random_access<Next>::operator[](typename Next::size_type) const’: prog.cpp:123:19: error: there are no arguments to ‘get_impl’ that depend on a template parameter, so a declaration of ‘get_impl’ must be available [-fpermissive]
Standard output is empty