//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // back_insert_iterator // Test nested types and data member: // template // class back_insert_iterator { // protected: // Cont* container; // public: // typedef Cont container_type; // typedef void value_type; // typedef void difference_type; // typedef back_insert_iterator& reference; // typedef void pointer; // }; #include #include #include template struct find_container : private std::back_insert_iterator { explicit find_container(C& c) : std::back_insert_iterator(c) {} void test() {this->container = 0;} }; template void test() { typedef std::back_insert_iterator R; C c; find_container q(c); q.test(); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); } int main() { test >(); }