avatar
Articles
101
Tags
30
Categories
26

Home
Archives
Tags
Categories
Link
About
detect
Search
Home
Archives
Tags
Categories
Link
About

detect

effctive c++ tips
Created2023-03-23|c++tips|c++
1. 除非有好的理由允许构造函数隐式转换,否则申明构造函数为explicit 2. default构造函数,copy构造函数,copy assignment操作符 新对象被定义一定有个构造函数被调用 1234Class w1;//default Class w2(w1);//copy构造Class w1=w1;//copy赋值操作符Class w3=w2;//copy构造 3. 类中声明常量 为确保此常量只有一个实例,用static 123class{ static const int Num=5;} 同时也可以使用enum 123class{ enum{Num=5};} enum特征: enum和define一样不允许指针指向自己,绝不会导致不必要的内存分配 实用主义,很多代码用了它 4. const食用技巧 1. const对象只能调用const成员函数、不能调用非const成员函数;非const对象可以调用const成员函数 引发原因: 由调用成员函数时隐式传入的当前对象的this指针引起。 ...
1…1011
avatar
Richard
If you can't explain it simply, you don't understand it well enough.
Articles
101
Tags
30
Categories
26
Follow Me
Announcement
blog is buliding!
Recent Post
Auto-encoder2025-06-09
矩阵计算2025-06-09
好运设计2025-05-30
JAX base2025-05-06
Python Multiprocess2025-05-05
C++ Embedding Python2025-05-05
Python tips2025-05-01
Pandas Tips2025-05-01
生成式奖励模型的几种方法2025-03-25
Let’s Verify Step by Step2025-03-24
Categories
  • DL17
    • Lee's HW1
    • Lee's notes15
    • code1
  • Math1
    • Bayesian Network and MCMC1
  • NJU course11
    • Crypto1
Tags
LLM algorithm GAN 实验报告 vim c++ git diffusion python ML hexo tool note paper GPT 神经网络 随笔 DS Metabit catalog RL resume nju Quant 机器学习 HW 实习 linux OS math
Archives
  • June 20252
  • May 20256
  • March 202510
  • February 20252
  • January 20256
  • October 20245
  • June 20241
  • May 20243
  • April 20243
  • March 20248
  • February 20246
  • January 202416
  • December 20238
  • November 20237
  • October 20233
  • September 20237
  • July 20233
  • June 20234
  • March 20231
Info
Article :
101
Run time :
Total Count :
264.1k
Last Push :
©2020 - 2025 By Richard
Framework Hexo|Theme Butterfly
Search
Loading the Database