/*************************************************************************> File Name: ex13.17.cpp> Author: > Mail: > Created Time: Tue 23 Apr 2024 09:48:13 AM CST************************************************************************/#include<iostream>usingnamespace std;staticint nextsn =1;classnumbered{public:int mysn;numbered():mysn(nextsn++){}// Unique serial number for each objectnumbered(const numbered &n):mysn(nextsn++){}// Copy creates a new unique idnumbered &operator=(const numbered &n){mysn = nextsn++;// Ensure unique id on assignmentreturn*this;}};voidf1(numbered s){cout << s.mysn << endl;}voidf2(const numbered &s){cout << s.mysn << endl;}intmain(){numbered a, b = a, c = b;f1(a);f1(b);f1(c);f2(a);f2(b);f2(c);return0;}
目录 yml文件什么是yml文件yml文件的优点使用场景脚本语言序列化配置文件 yml的基本语法yml支持的数据类型字面量对象(属性和值)、Map(键值对)数组复合结构 Spring Boot配置文件的值注入第一种读取方式Value第二种读取方式ConfigurationProperties第三种读取方式自动装配Enviro…