操作符重载手册

C#菜鸟教程学习笔记 C#菜鸟教程学习笔记 C#简介 C# 是一种编程语言,它是由微软开发的。 C# 编程是基于 C 和 C++ 编程语言的,它与 Java 也非常相似。 C# 是 .Net 框架的一部分,且用于编写 .Net 应用程序。 .Net 框架(.Net Framework)能编写出下面类型的应用程序: ①Windows 应用程序 ②Web 应用程序 ③Web 服务 常用的C# 编程的开发工具:Visual Studio(VS:可视化工作室) C#程序结构 一个 C# 程序(C# 文件的后缀为 .cs)主要包括以下部分 阅读详情
一、重载规则

I.可以重载的操作符

+-*/%
^&|~!
=><+=-=
*=/=%=^=&=
|=>><<>>=<<=
==!=>=<=&&
||++--->*,
->[]()operator newoperator new[]
operator deleteoperator delete []

II.不能重载的操作符

::..*? :
sizeoftypeidnewdelete
static_castdynamic_castconst_castreinterpret_cast

III.基本规则

1.一元操作符可以是不带参数的 成员函数[1]或带一个参数的 非成员函数[1]。
2.二元操作符可以是带一个参数的成员函数 [1]或带两个参数的非成员函数 [1]。
3.operator=、operator[]、operator()、operator->只能定义为成员函数 [1]。
4.operator->的返回值必须是一个指针或能使用->的对象。
5.重载 operator++ 和 operator-- 时带一个 int 参数表示后缀,不带参数表示前缀。
6.除 operator new 和 operator delete 外,重载的操作符参数中至少要有一个非内建数据类型。
7.x@y 搜索范围为:x 成员函数--> 全局函数/X所在名字空间中的函数/Y所在名字空间中的函数/X的友元函
   数/Y的友元函数。
8.重载的的操作符应尽量模拟操作符对内建类型的行为。

二、使用重载


I.操作符重载的一些建议

    1.只将会改变第一个参数的值的操作符(如: +=)定义为成员函数,而将返回一个新对象的操作符(如: +)定义为非成员函数(并使用 += 来实现)。
    2.只有非成员函数才能在左参数上实施性别转换,如果需要进行转换则应将操作符定义为非成员函数。
    3.对一元操作符, 为避免隐式转换最好将其重载为成员函数。
    4.对二元操作符, 为能在左操作数上能进行和右操作数一样的隐式转换, 最好将其重载为非成员函数。
    5.为了遵照使用习惯,operator>>、operator<< 应定义为非成员函数。
    6.重载 operator[] 之类的操作符, 应尽量提供 const 版本和非 const 版本。
    7.关于将操作符定义为成员或非成员可参考以下建议:
操作符建 议
所有一元操作符 成员
= () [] -> 必须为成员
+= -= /= *= ^= &= != %= >>= <<= 成员
其它二元操作符 非成员

    8.如果默认操作符已经可以施用于你的型别上, 则应尽量避免重载此操作符. 如 operator, 、operator&(取地址) 等等.

II. 重载 operator new

    1.为什么要重载 operator new ?

[效率问题] 通常系统默认提供的分配器速度极慢, 而且分配小型对象时空间浪费严重.
[改变行为] 默认的分配器失败时会抛出异常, 或许你想改变这种行为.

    2. operator new 的行为

[区分三个不同的 new]
    new 操作符(new 表达式, new operator, new expression): 通常我们调用 X * pX = new X 时使用的就是这个操作符, 它由语言内建, 不能重载, 不能改变其行为. 它包括分配内存的 operator new 和调用构造函数的 placement new.
    operator new :opeator new 是一个函数, void * operator new(size_t size) . 它分配指定大小的内存, 可以被重载, 可以添加额外的参数, 但第一个参数必须为 size_t. operator new 除了被 new operator 调用外也可以直接被调用: void * rawMem = operator new(sizeof(X)).
    placement new : placement new 在一块指定的内存上使用构造函数, 包含头文件 <new> 之后也可以直接使用 placement new: X * pX = new (rawMem) X. [2]

    与 new operator 类似, 对于 delete operator, 也存在 operator delete: void operator delete(void *), 析构方法 pX->~X().

[operator new 的错误处理]
    默认的 operator new 在内存分配失败时将会抛出 std::bad_alloc 异常; nothrow new [3]
(X * pX = new (nothrow) X) 在内存分配失败时将会返回 0 . 这种行为可以通过设置 new-handler 来改变. new-handler 是一个回调函数指针, typedef void(*new_handler)(void). 通过 set_new_handler(new_handler) 函数设置回调句柄后, 如果分配内存失败, operator new 将会不断的调用 new-handler 函数, 直到找到足够的内存为止. 为了避免死循环, new-handler 函数必须具备以下行为之一:
    (1).找到可用的内存.
    (2).安装其它的 new-handler 函数.
    (3).卸除 new-handler, 即 set_new_hanlder(0), 这样下此循环将恢复默认行为抛出异常或返回 0.
    (4).抛出异常.
    (5).保存错误日志, 退出程序.

    3.准备重载 operator new

    重载 operator new 时需要兼容默认的 operator new 错误处理方式. 另外, C++ Standard 规定当要求的内存为 0 byte 时也应该返回有效的内存地址. 所以 operator new 的重载实现应大致如下:
void * ... operator new(size_t size ... )
{
    if(size == 0)
         size = 1;

    while(1)
    {
        ... // allocate memery
        if(allocate sucessfull)
            return ... // return the pointer.

        new_handler curhandler = set_new_handler(0);
        set_new_handler(curhandler); // get current new handler

        if(curhandler == 0)
            (*curhandler)();
        else
            throw std::bad_alloc();
    }
}
    重载 operator delete 简单许多, 只需注意 C++ Standard 要求删除一个 NULL 是安全的即可.

     4.重载 operator new

    opeator new 的重载和其它操作符大不相同.首先, 即使你不重载, 默认的 operator new 也可施用于你的自定义型别上(operator, 也具有此特性), 而其它操作符如果不进行重载就无法使用. 其次, 其它重载其它操作符时参数个数都是固定的, 而 operator new 的参数个数是可以任意的, 只需要保证第一个参数为 size_t, 返回类型为 void * 即可, 而且其重载的参数类型也不必包含自定义类型. 更一般的说, operator new 的重载更像是一个函数的重载, 而不是一个操作符的重载.

[★ 用不同的参数重载 operator new]

    通过使用不同的参数类型, 可以重载 operator new, 例如 :
void * operator new(size_t size, int x, int y, int z)
{
    ...
}

X * pX = new (1, 2, 3) X;
    你还可以为 operator new 的重载使用默认值, 其原则和普通函数重载一样, 只要不造成和已存在的形式发生冲突即可. 可能你已经想到了, 你甚至还可以在 operator new 中使用不定参数, 如果你真的需要的话.
void * operator new(size_t size, int x, int y = 0, int z = 0)
{
    ...
}

X * pX = new (10) X;
Y * pY = new (10, 10) Y;
Z * pZ = new (10, 10, 10) Z;

...
void * operator new(size_t size, ...)
...
    在全局空间中也可直接重载 void * operator new(size_t size) 函数, 这将改变所有默认的 new 操作符的行为, 不建议使用.

[★ 重载 class 专属的 operator new]

    为某个 class 重载 operator new 时 必须定义为类的静态函数[4], 因为 operator new 会在类的对象被构建出来之前调用. 即是说调用 operator new 的时候还不存在 this 指针, 因此重载的 operator new 必须为静态的. 当然在类中重载 operator new 也可以添加额外的参数, 并可以使用默认值.另外, 和普通函数一样, operator new 也是可以继承的.
class X{
...
static void * operator new(size_t size); // ... (1)
static void * operator new(size_t size, int); // ... (2)
};

class Y : public X{
...
};

class Z : public X{
...
static void * operator new(size_t size); // ... (3)
};

X * pX1 = new X; // call (1)
X * pX2 = ::new X; // call default operator new
X * pX3 = new (0) X; // call (2)

Y * pY1 = new Y; // call (1)

Z * pZ1 = new Z; // call (3)
Z * pZ2 = ::new Z; // call default operator new
Z * pZ3 = X::new Z; // error, no way to call (1)
Z * pZ4 = new (0) Z; // error, no way to call (2)

    5.重载 operator delete

    如果你重载了一个 operator new, 记得一定要在相同的范围内重载 operator delete. 因为你分配出来的内存只有你自己才知道如何释放. 如果你忘记了, 编译器不会给你任何提示, 它将会使用默认的 operator delete 来释放内存. 这种忘记的代价是惨重的, 你得时刻在写下 operator new 的同时写下 operator delete.
    如果在类中使用 operator delete, 也必须将其声明为静态函数. 因为调用 operator delete 时对象已经被析构掉了. operator delete 的重载可以有两种形式:
(1) void operator delete(void * mem)
(2) void operator delete(void * mem, size_t size)
    并且这两种形式的 operator delete 可以同时存在, 当调用 delete px 时, 如果 (1) 式存在的话将调用 (1) 式. 只有在 (1) 式不存在时才会调用 (2) 式. 对第 (2) 种形式的 operator delete, 如果用基类指针删除派生类对象, 而基类的析构函数没有虚拟的时候, size 的值可能是错误的.

三、重载参考

收拢全部

- const Carrot operator+(const Carrot& lhs, const Carrot& rhs)
{
    Carrot result = lhs;
    return result += rhs;
}

【注】1. 如果可能, 应考虑使用 operator+= 来实现 operator+ .
         2. operator+ 不能返回引用, 应返回值类型.
         3. 为了阻止形如 (a + b) = c 的调用, 应将返回值声明为 const .

· const Carrot operator-(const Carrot& lhs, const Carrot& rhs)
- const Carrot operator*(const Carrot& lhs, const Carrot& rhs)
{
    ...
}

【注】1. operator* 还可以 重载为提领操作符.

· const Carrot operator/(const Carrot& lhs, const Carrot& rhs)
· const Carrot operator%(const Carrot& lhs, const Carrot& rhs)
· const Carrot operator^(const Carrot& lhs, const Carrot& rhs)
- const Carrot operator&(const Carrot& lhs, const Carrot& rhs)
{
    ...
}

【注】1. operator& 还可以 重载为取地址操作符.

· const Carrot operator|(const Carrot& lhs, const Carrot& rhs)
- const Carrot Carrot::operator-() const
{
    Carrot result = (*this);
    ... // chang the value to negative
    return result;
}

【注】1. 一元操作符, 取负.

· const Carrot Carrot::operator~() const
· bool Carrot::operator!() const
· bool operator>(const Carrot& lhs, const Carrot& rhs)
· bool operator<(const Carrot& lhs, const Carrot& rhs)
- Carrot& Carrot::operator=(const Carrot& rhs)
{
    if(this == &rhs)
        return *this; // may be (*this) == rhs if needs.

    Barley::operator=(rhs); // if Carrot derived from Barley

     ... // assignments every memeber of Carrot.

    return *this;
}

【注】1. 为了实现形如 x=y=z=0 的串联赋值操作, operator= 必须传回 *this 的非常量引用.
         2. 在赋值时应注意检查是否为自赋值 ( a = a ).

- Carrot& Carrot::operator+=(const Carrot& rhs)
{
     ...
    return *this;
}

【注】1. C++ 允许 (x += 1) = 0 形式的赋值操作, operator+= 必须传回 *this 的非常量引用.

· Carrot& Carrot::operator-=(const Carrot& rhs)
· Carrot& Carrot::operator*=(const Carrot& rhs)
· Carrot& Carrot::operator/=(const Carrot& rhs)
· Carrot& Carrot::operator%=(const Carrot& rhs)
· Carrot& Carrot::operator^=(const Carrot& rhs)
· Carrot& Carrot::operator&=(const Carrot& rhs)
· Carrot& Carrot::operator|=(const Carrot& rhs)
- istream& operator>>(istream& _IStr, Carrot& rhs)
{
    ...
    return _IStr;
}

【注】1. 为了遵照使用习惯(cin>>x 而不是 x>>cin), 对流操作的 operator>> 应为非成员函数.

- ostream& operator<<(ostream& _OStr, const Carrot& rhs)
{
    ...
    return _OStr;
}

- const Carrot operator>>(const Carrot& lhs, int rhs)
{
    Carrot result = lhs;
    ...
    return result;
}

【注】1. 移位操作的重载方式.

· const Carrot operator<<(const Carrot& lhs, int rhs)
- Carrot& Carrot::operator>>=(int rhs)
{
     ...
    return *this;
}

【注】1. 移位操作.

· Carrot& Carrot::operator<<=(int rhs)
- bool operator==(const Carrot& lhs, const Carrot& rhs)
{
    ...
}

· bool operator!=(const Carrot& lhs, const Carrot& rhs)
· bool operator>=(const Carrot& lhs, const Carrot& rhs)
· bool operator<=(const Carrot& lhs, const Carrot& rhs)
- bool operator&&(const Carrot& lhs, const Carrot& rhs) X
{
    ...
}

【注】1. 基于以下原因, 你应该避免重载 operator&& 和 operator|| :
               (1). && 和 || 是一个逻辑操作符, 只对 bool 型别有才有明确的语意.
               (2). 重载的 operator&& 和 operator|| 无法模拟操作符默认的 骤死式语义[5].
               (3). 你无法保证重载后操作符的参数求值次序(C++ Stand 保证了默认的 && 和 || 按从左到右求值).
         2.自定义型别可以考虑提供到 bool 的转型操作来支持此操作符.

· bool operator||(const Carrot& lhs, const Carrot& rhs) X
- Carrot& Carrot::operator++()
{
    (*this) += 1; // or other implement
    return *this;
}

【注】1. 前置操作(prefix): ++carrot

- const Carrot Carrot::operator++(int)
{
    Carrot oldValue = *this;
    ++(*this);
    return oldValue;
}

【注】1. 后置操作(postfix): carrot++ 调用时编译器自动生成一个 0 作为参数.
         2. 为了禁止 carrot++++ 操作, 返回值应为 const.
         3. 从实现和参数可以看出,后置操作的效率远远低于前置操作, 所以如非必要尽量使用前置操作.
         4. 为了保证递增行为一致, 并便于维护后置操作最好使用前置操作来完成递增行为.

· Carrot& Carrot::operator--()
· const Carrot Carrot::operator--(int)
- const Carrot operator,(const Carrot& lhs, const Carrot& rhs) X
{
    ...
}

【注】1. 基于以下原因, 你应该避免重载 operator, :
               (1). 即使没有重载, 默认,号操作符也可以施用于自定义型别上.
               (2). C++ 保证 , 操作符的求值是从左到右的, 而重载后无法保证此行为.

- const PMFC Carrot::operator->*(ReturnType (T::*pmf)()) const
{
    ...
}

【注】1. operator->* 重载比较少见, 有兴趣可参考 Implementing operator->* for Smart Pointers.

- const Carrot* Carrot::operator&() const X
{
    ...
}

【注】1. 你应该尽量避免重载取地址操作符.

- Coca& Carrot::operator*()
{
    ...
}

【注】1. 重载提领操作符应提供 const 版和非 const 版.

· const Coca& Carrot::operator*() const
- Coca* Carrot::operator->()
{
    ...
}

【注】1. 重载 operator-> 应提供 const 版和非 const 版.
         2. operator-> 的返回值必须为一个指针或可以应用 -> 操作的类型.
         3. 如果 operator-> 的返回的不是一个指针, C++ 会继续在返回类型上应用 -> 直到得到一个指针为止.

· const Coca* Carrot::operator->() const
- Coca& Carrot::operator[](KeyType index)
{
    ...
}

【注】1. operator[] 应提供 const 版本和非 const 版.
         2. KeyType 可以为任意类型, 但通常为 int 型.

· const Coca& Carrot::operator[](KeyType index) const
- AnyType Carrot::operator()(...)
{
    ...
}

【注】1. operator () 重载的是函数运算符, 改变表达式优先级的 () 是不能重载的.
         2. 重载了 operator() 的对象被成为仿函数, 使用方法和函数指针类似.

- static void* Carrot::operator new(size_t size, ...)
{
    if(size == 0)
         size = 1;

    while(1)
    {
        ... // allocate memery
        if(allocate sucessfull)
            return ... // return the pointer.

        new_handler curhandler = set_new_handler(0);
        set_new_handler(curhandler); // get current new handler

        if(curhandler == 0)
            (*curhandler)();
        else
            throw std::bad_alloc();
    }

【注】1. 参考 重载 operator new.

· static void* Carrot::operator new[](size_t size, ...)
- static void Carrot::operator delete(void * memory, size_t size)
{
    if(memorty == NULL)
        return;
    ...
}

【注】1. 参考 重载 operator new.

· static void Carrot::operator delete[](void * momery, size_t size)

▲注:
1.本文中成员函数仅指非静态成员函数;非成员函数包括自由函数,静态成员函数,友元函数。 ←
2.这种调用方法使用了 operator new 的一种重载形式: void * operator new(size_t, void * buff) . 这种重载方式直接返回了传入的内存地址, 所以这种调用方式中 operator new 其实什么也没做, 于是这个 new operator 调用只使用了其中调用构造函数的部分, 相当于是在调用 placement new. 该重载在 VC7.1 中定义如下:
#define __PLACEMENT_NEW_INLINE
inline void *__cdecl operator new(size_t, void *_Where) _THROW0()
{ // construct array with placement at _Where
return (_Where);
}
←
3.和 placement new 一样, nothrow new 也是 operator new 的一种重载形式, nothrow 是 中声明的一个对象. 该重载在 VC7.1 中的声明为:
...
struct nothrow_t
    { // placement new tag type to suppress exceptions
    };

extern const nothrow_t nothrow; // constant for placement new tag
...
void *__cdecl operator new(size_t, const std::nothrow_t&)
    _THROW0();
←
4.在 VC7.1 中, 不将 operator new 声明为静态函数仍然可以通过编译, 但是如果在函数里面使用了非静态成员则会产生编译错误. 可见, 即使不将 operator new 声明为静态函数编译器也会将其作为静态函数来处理的. 使用是即使编译器默认把 operator new 当作静态函数也应该显式的将其声明为 static 函数. ←
5. 即对 && 操作符如果左操作数为 false, 则直接返回 false 而不会去检测右操作数; 对 || 操作符如果左操作数为 true, 则直接返回 true 而不会检测右操作数的值. 于是类似这样的代码可以是安全的:
    if( (p != NULL) && strlen(p) < 10 )...
如果 p == NULL, strlen 就不会被调用. 但是重载的 operator&& 和 operator|| 是作为一个函数, 要在所有的参数求值完成后才会调用此操作符. ←

▲参考资料:

1. Bjarne Stroustrup.The C++ Programming Language(Special Edition)
2. Scott Meyers.Effective C++(2nd Edition)
3. Andrei Alexandrescu.Modern C++ Design
4. Robert B.Murray.C++ Strategies and Tactics
5. Scott Meyers.More Effective C++
6. John Lakos.Large-Scale C++ Software Design
7. Scott Meyers.Implementing operator->* for Smart Pointers
 
Arduino IDE 2.2.1最新版配置ESP32/ESP8266开发环境(附离线包+避坑指南) 本文详细介绍了如何在Arduino IDE 2.2.1中高效配置ESP32/ESP8266开发环境,包括离线包安装、开发板管理器地址配置及常见问题解决方案。针对国内开发者遇到的下载缓慢和安装失败问题,提供了完整的离线安装方案和避坑指南,帮助开发者快速搭建稳定的开发环境。 阅读详情

相关推荐

【Clickhouse从入门到精通】第60篇:ClickHouse生态总结与未来展望

ClickHouse系列收官总结 本文作为《ClickHouse从入门到精通》系列的第60篇收官之作,系统回顾了整个系列的知识体系。文章从基础概念到高级应用,全面梳理了ClickHouse的核心技术: 知识体系:完整回顾了60篇文章的知识图谱,包括列式存储原理、MergeTree引擎家族、分布式架构等核心内容 生态工具:详细盘点了ClickHouse的企业版工具、运维监控、数据集成和可视化方案 版本演进:分析了从21.x到24.x的主要版本特性升级 未来趋势:展望了向量化引擎、湖仓一体、AI集成等发展方向

xyghehehehe的专栏 453

C++操作符重载

简要介绍了各种操作符的重载方式与实现

shadow_xwl的博客 5747

Vercel静态站被墙别慌!手把手教你用Cloudflare免费CDN+域名解析搞定DNS污染

本文详细介绍了如何利用Cloudflare免费CDN和域名解析解决Vercel静态网站遭遇DNS污染的问题。通过诊断DNS污染、设计Cloudflare解决方案架构、实战配置步骤以及高级调优技巧,帮助用户快速恢复站点访问并提升防护能力。

weixin_27442001的博客 720

C++语言学习(八)——操作符重载

C++语言学习(八)——操作符重载 一、操作符重载基础 1、操作符重载的语法 通过operator关键字可以定义特殊的函数,operator本质是通过函数重载操作符。 Type operator operatorname(const Type p1, const Type p2) { Type ret; return ret; } 2、友元函数重载操作符 可以将操作符重载函数声明...

weixin_34198881的博客 709

AIDD机器学习深度学习药物发现与设计教程总结

AIDD(AI Drug Discovery & Design):是近年来非常火热的技术应用,且已经介入到新药设计到研发的大部分环节当中,为新药发现与开发带来了极大的助力。倾向于机器对数据库信息的自我学习,可以对数据进行提取和学习,一定程度上避免了化合物设计过程中的试错路径,同时还会带来很多全新的结构,为药物发现打破常规的结构壁垒。覆盖了机器学习和深度学习,能与新药研发相结合并实质性的应用到靶点预测、高通量筛选、药物设计、药物的ADMET性质预测等;且算力方面,由早期应用于药物发现领域的决策树、随机

wutianlin0723的博客 6831

项目回顾一:《高速多端口共享缓存模块》

本帖子仅为了回顾一下一年前自己动手完成的第一个数字ic设计项目的历程,为复试做一下准备,完成的这个sramc模块花了整整四个月的时间,从0到12个模块的代码产出以及模块的验证,虽然没有拿奖,也没有进入复赛,设计过程中使用的技术手段和算法也不太成熟,但这这是一个值得记录的过程!

weixin_60261760的博客 1272

C++ 操作符重载

输出操作符"<<" 和输入操作运算符">>" 在C++中,左移运算符<<可以和cout一起输出,因此也常被称为"流插入运算符",或"输出运算符"。 但实际上!<<本来没有这样的功能,之所以能和cout一起使用来输出数据,是因为此<<操作符被重载了 输出操作符"<<" cout是ostream类的对象,ostream类和cout都是在头文件 <iostream> 中声明的,ostream类将<<重载为其成员函数,

Chroniccandy的博客 2010

PCIe协议之 Equalization篇 之 理论篇 之 FFE

作为最后一道“精加工”工序,DFE利用其不放大噪声的优势,精准地消除残余的、强烈的后光标ISI,最终得到一个非常干净、张得很开的眼图,供判决器使用。信号经过信道衰减后变得模糊,首先由CTLE进行“粗调”,提供一个宽频带的增益,将眼图初步打开,为后面的DFE创造一个可以正常工作的信号环境。,它通过将输入信号在不同时间点上的多个副本(称为“抽头”)进行加权求和,来直接塑造或“整形”输出信号的波形。:这是最主要的信号路径,通常系数为正值,决定了信号的幅度。:将所有加权后的信号相加,产生最终的均衡输出。

那么菜的博客 770

c++操作符重载

转自https://www.cnblogs.com/xudong-bupt/p/3557525.html 1.什么是操作符重载   可以使用分词将操作符重载理解为:操作符+重载。   C++中的操作符很多,如+,-,*,\等等。   C++中的重载也是C++中面向对象多态的体现。   简单说操作符重载:     C++中有:int a=2+3;  那么a=5     操作符重载可以实...

hjxu2016的博客 4096

RT-DETR-R18 上下文信息融合:引入全局特征提升遮挡目标检测

"""轻量化全局特征提取器(2层Transformer编码器)"""# 特征投影层(将多尺度特征统一维度)# 轻量化Transformer编码器(分组卷积优化)# 全局特征池化(输出 [bs, hidden_dim])# local_features: 多尺度特征列表 [C3, C4, C5],各 [bs, c, h, w]# 统一投影至 hidden_dim 并展平为序列# Transformer编码全局上下文# 全局池化得到全局向量。

走向CTO的路上... 506

Newton & Nvidia 开源 GPU 加速机器人仿真器入门教程(一)

Newton 是一个 GPU 加速、可扩展和可微分的物理仿真引擎,专为机器人、研究和高级仿真工作流而设计。Newton 基于 NVIDIA Warp 并集成了 MuJoCo Warp,为用户和开发人员提供了高性能仿真、现代 Python API 和灵活的架构。

机器人控制与仿真应用 1490

C++运算符重载详解

C++运算符重载详解

qq_52905520的博客 4万+

BMP280气压传感器原理图设计,已量产(压力传感器)

做嵌入式项目时,“小而精” 的传感器模块永远是刚需 —— 尤其是需要同时测气压和温度的场景,比如无人机定高、环境监测节点、穿戴设备等。最近捣鼓了一款 BMP280 的 Breakout 板,封装做得很紧凑,同时兼顾了稳定性和兼容性,这里单聊硬件设计细节。

不脱发的程序猿 313

C++操作符重载手册

C++操作符重载手册 http://www.adintr.com/myarticle/operator.html by adie  Dec,2005 一、重载规则 I.可以重载的操作符 + - * / % ^ & | ~ ! = > += -= *= /= %= ^= &=

1813

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

上一篇: 一道有趣的笔试题
下一篇: 存储技术磁盘阵列(Disk Array)原理
MapReduce
博客等级 码龄20年 8粉丝 10原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址