⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base_cursor.hpp

📁 矩阵运算源码最新版本
💻 HPP
字号:
// Software License for MTL// // Copyright (c) 2007 The Trustees of Indiana University. All rights reserved.// Authors: Peter Gottschling and Andrew Lumsdaine// // This file is part of the Matrix Template Library// // See also license.mtl.txt in the distribution.#ifndef MTL_BASE_CURSOR_INCLUDE#define MTL_BASE_CURSOR_INCLUDEnamespace mtl { namespace detail {// base class for different cursors, works with pointers and integerstemplate <class Key> class base_cursor { public:    typedef Key          key_type;    typedef base_cursor  self;    base_cursor () {}     base_cursor (key_type key) : key(key) {}    key_type operator*() const     {       return key;     }    self& operator++ ()     {       ++key; return *this;     }    self operator++ (int)     {       self tmp = *this;       ++key;       return tmp;     }    self& operator-- ()     {       --key;       return *this;     }    self operator-- (int)     {       self tmp = *this;       --key;       return tmp;     }    self& operator+=(int n)     {       key += n;       return *this;     }      self operator+(int n) const    {	self tmp = *this;	tmp+= n;	return tmp;    }        self& operator-=(int n)     {       key -= n;       return *this;     }    int operator-(const self& cc) const     {	return this->key - cc.key;    }    bool operator==(const self& cc) const     {      return key == cc.key;     }    bool operator!=(const self& cc) const     {      return !(*this == cc);     }        key_type key;}; // base_cursor}} // namespace mtl::detail #endif // MTL_BASE_CURSOR_INCLUDE 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -