MoreEffective.rar

  • 李东日
    了解作者
  • C++
    开发工具
  • 58KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 3
    下载次数
  • 2008-01-02 23:06
    上传日期
more efftive 代码
MoreEffective.rar
  • More Effective
  • 12
  • 12-05-04.cpp
    155B
  • 12-03-2.cpp
    292B
  • 12-02-01.cpp
    173B
  • 12-01-01-3.cpp
    291B
  • 12-07-01.cpp
    442B
  • 12-01-02.cpp
    320B
  • 12-05-03.cpp
    155B
  • 12-05-02.cpp
    241B
  • 12-08-01.cpp
    415B
  • 12-04-04.cpp
    335B
  • 12-06-01.cpp
    582B
  • 12-06-06-1.cpp
    293B
  • 12-06-05-1.cpp
    453B
  • 12-06-05-3.cpp
    748B
  • 12-09-03.cpp
    317B
  • 12-08-02.cpp
    427B
  • 12-07-02.cpp
    419B
  • 12-07-06.cpp
    546B
  • 12-10-01.cpp
    405B
  • 12-07-05.cpp
    266B
  • 12-04-03.cpp
    402B
  • 12-02-02.cpp
    180B
  • 12-02-03.cpp
    390B
  • 12-01-01-2.cpp
    285B
  • 12-10-02.cpp
    278B
  • 12-07-04.cpp
    314B
  • 12-05-01.cpp
    200B
  • 12-10-03.cpp
    379B
  • 12-04-01.cpp
    475B
  • 12-04-02-1.cpp
    360B
  • 12-10-04.cpp
    557B
  • 12-09-02.cpp
    369B
  • 12-06-06-2.cpp
    523B
  • 12-09-01.cpp
    332B
  • 12-01-01-1.cpp
    290B
  • 12-03-1.cpp
    338B
  • 12-06-05-2.cpp
    269B
  • 12-06-02.cpp
    648B
  • 12-06-03.cpp
    377B
  • 12-06-04.cpp
    354B
  • 12-07-03.cpp
    755B
  • 12-04-02-2.cpp
    557B
  • 12-03-3.cpp
    376B
  • 11
  • 11-01-02-2.cpp
    545B
  • 11-03-02-3.cpp
    562B
  • 11-01-02-3.cpp
    396B
  • 11-05-01-1.cpp
    293B
  • 11-02-02.cpp
    666B
  • 11-05-03-2.cpp
    737B
  • 11-03-01-2.cpp
    224B
  • 11-05-02-1.cpp
    553B
  • 11-06-04.cpp
    294B
  • 11-04-1.cpp
    485B
  • 11-02-01-2.cpp
    687B
  • 11-06-02.cpp
    212B
  • 11-05-03-1.cpp
    715B
  • 11-03-02-2.cpp
    291B
  • 11-01-04.cpp
    518B
  • 11-01-03-1.cpp
    264B
  • 11-05-02-2.cpp
    702B
  • 11-01-02-1.cpp
    311B
  • 11-06-01.cpp
    212B
  • 11-03-02-1.cpp
    311B
  • 11-02-03.cpp
    1.2KB
  • 11-06-03.cpp
    295B
  • 11-01-01.cpp
    270B
  • 11-05-01-2.cpp
    411B
  • 11-03-01-1.cpp
    260B
  • 11-02-01-1.cpp
    444B
  • 11-01-03-2.cpp
    437B
  • 11-04-2.cpp
    220B
  • 11-03-02-4.cpp
    383B
  • 05
  • 05-02-04.cpp
    741B
  • 05-01-03.cpp
    1.9KB
  • 01
  • 01-01-3.cpp
    1.4KB
  • 01-01-2.cpp
    1.3KB
  • 01-01-1.cpp
    345B
  • 16
  • 16-02-02-2.cpp
    583B
  • 16-03-02.cpp
    389B
  • 16-02-02-1.cpp
    965B
  • 16-01-03-1.cpp
    303B
  • 16-02-04.cpp
    884B
  • 16-02-05.cpp
    870B
  • 16-01-01-2.cpp
    362B
  • 16-01-01-1.cpp
    196B
  • 16-03-01.cpp
    303B
  • 16-02-07.cpp
    953B
  • 16-01-02.cpp
    467B
  • 16-03-03-2.cpp
    361B
  • 16-02-08.cpp
    1KB
  • 16-03-03-1.cpp
    333B
  • 16-02-03.cpp
    1017B
  • 16-02-06.cpp
    770B
  • 16-02-01.cpp
    1.4KB
内容介绍
#include <iterator> using namespace std; template <class T, size_t N> struct block { typedef T value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef ptrdiff_t difference_type; typedef size_t size_type; typedef pointer iterator; typedef const_pointer const_iterator; iterator begin() { return data; } iterator end() { return data + N; } const_iterator begin() const { return data; } const_iterator end() const { return data + N; } typedef reverse_iterator<const_iterator> const_reverse_iterator; typedef reverse_iterator<iterator> reverse_iterator; reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } reference operator[](size_type n) { return data[n]; } const_reference operator[](size_type n) const { return data[n]; } size_type size() const { return N; } size_type max_size() const { return N; } bool empty() const { return N == 0; } void swap(block& x) { for (size_t n = 0; n < N; ++n) std::swap(data[n], x.data[n]); } T data[N]; }; template <class T, size_t N> bool operator==(const block<T,N>&x, const block<T,N>& y) { for (size_t n = 0; n < N; ++n) if (x.data[n] != y.data[n]) return false; return true; } template <class T, size_t N> bool operator<(const block<T,N>&x, const block<T,N>& y) { for (size_t n = 0; n < N; ++n) if (x.data[n] < y.data[n]) return true; else if (y.data[n] > x.data[n]) return false; return false; } int main(int argc, char *argv[]) { block<int, 6> A = {1, 4, 2, 8, 5, 7}; return 0; }
评论
    相关推荐