#pragma once
#ifndef MYCLASS_H
#define MYCLASS_H
#include <iostream>
#include <memory>
class NeptuneScene;
class NeptuneElem;
class NeptuneTrack;
class YouClass
{
public:
YouClass() {}
void Printing(const std::string& str)
{
std::cout << str.c_str() << std::endl;
}
};
template<typename C, typename U>
class MyClass
{
public:
MyClass();
U const& Max(const C& a, const U& b);
template<typename T>
void Printg(const std::string& a, const T& b);
protected:
private:
};
class He
{
public:
He();
template<typename H>
void tempHe(const std::string& path,const H& type);
private:
NeptuneScene* ms_pNeptuneScene;
NeptuneElem* ms_pNeptuneElem;
NeptuneTrack* ms_pNeptuneTrack;
};
#endif
#include "MyClass.h"
#include "../neptune.pb.h"
#pragma comment(lib,"libprotobufd.lib")
#pragma comment(lib,"libprotocd.lib")
using namespace std;
template<typename C,typename U>
MyClass<C,U>::MyClass()
{
}
template<typename C, typename U>
U const& MyClass<C,U>::Max(const C& a, const U& b)
{
return a < b ? b : a;
}
template<typename C, typename U>
template<typename T>
void MyClass<C, U>::Printg(const std::string& a, const T& b)
{
if (typeid(*b) == typeid(YouClass))
{
cout << "this is You Class" << endl;
}
else {
cout << "not id" << endl;
}
b->Printing(a);
}
He::He()
{
std::cout << "this He create" << std::endl;
ms_pNeptuneScene = new NeptuneScene;
ms_pNeptuneElem = new NeptuneElem;
ms_pNeptuneTrack = new NeptuneTrack;
}
template<typename H>
void He::tempHe(const string& path,const H& type)
{
cout << path.c_str() << endl;
cout << typeid(type).name() << endl;
ms_pNeptuneScene->set_name("hello NeptuneScene.");
cout << ms_pNeptuneScene->name() << endl;
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具