64,654
社区成员
发帖
与我相关
我的任务
分享
# include <iostream> //报错问题就出在这里,导入iostream时报的错,因为下一行设置过断点还是错,所以是这里的问题
using namespace std;
int main()
{
int number;
cout<<"Please input a number:"<<endl;
cin>>number;
cout<<"You had inputted "<<number<<" just now!"<<endl; //一个很简单的输入输出程序
return 0;
}
template<>
class allocator<void>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
};
/**
* @brief The @a standard allocator, as per [20.4].
*
* See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt04ch11.html
* for further details.
*/
template<typename _Tp>
class allocator: public __glibcxx_base_allocator<_Tp> //这里报错,它说expected'{'before'<'token
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
allocator() throw() { }
allocator(const allocator& __a) throw()
: __glibcxx_base_allocator<_Tp>(__a) { }
template<typename _Tp1>
allocator(const allocator<_Tp1>&) throw() { }
~allocator() throw() { }
// Inherit everything else.
};