摘要:前言 Http 缓存机制作为 web 性能优化的重要手段,对于从事 Web 开发的同学们来说,应该是知识体系库中的一个基础环节,同时对于有志成为前端架构师的同学来说是必备的知识技能。但是对于很多前端同学来说,仅仅只是知道浏览器会对请求的静态文件进行缓存,但是为什么被缓存,缓存是怎样生效的,却并不是很
阅读全文
摘要://用auto非类型模板参数 #include <iostream> using namespace std; template<auto c> auto foot() { cout << c << endl; return c; } int main4() { foot<312>(); int m
阅读全文
摘要://使用using继承所有的构造函数 #include "tmp.h" #include <iostream> using namespace std; struct P1 { P1() { cout << "p1" << endl; }; //error //P1(int m) = default
阅读全文
摘要:1 /*test for struct binding*/ 2 3 #include <string> 4 #include <iostream> 5 using namespace std; 6 //命名空间 可以缩写为A::B 7 namespace NA::NB 8 { 9 class Dat
阅读全文
摘要:1.光线追踪的原理是从屏幕前或者camera 向屏幕上的每一个像素投射光线, 然后找到与屏幕最近的物体相交,确定交点,确定材质 1.镜面, 继续追踪光线,肯定是要算反射光线,还有投影矩阵,然后继续找与当前交点所在平面最近的点做交点(所谓的递归) 2.环境光, 返回环境光的颜色 3.光线与光源碰撞,直
阅读全文