企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
~~~ #include <iostream> #include <string> using namespace std; class Maker { friend ostream& operator<<(ostream &out, Maker &m); public: Maker(int id, string name) { this->id = id; this->name = name; } public: int id; string name; }; ostream& operator<<(ostream &out, Maker &m) { cout << m.id << " " << m.name << endl; return out; } void test01() { Maker m(10, "小花"); cout << m << endl; cout << endl; } int main() { test01(); getchar(); return EXIT_SUCCESS; } ~~~