Ver3.0 ๐๏ธ C++ ๋ค์์คํ์ด์ค์ ๋ชจ๋ ์์คํ ์ ํตํ ๋๊ท๋ชจ ํ๋ก์ ํธ ๊ตฌ์กฐํ

๐๏ธ C++ ๋ค์์คํ์ด์ค์ ๋ชจ๋ ์์คํ ์ ํตํ ๋๊ท๋ชจ ํ๋ก์ ํธ ๊ตฌ์กฐํ
๋ํ ํ๋ก์ ํธ๋ ๊น๋ํ๊ฒ! ์ฝ๋ ๊ด๋ฆฌ์ ์ ์์ ํํค์ณ๋ณด์ ๐ก
์ผ ์์งํ C++ ํ๋ก์ ํธ ๊ท๋ชจ๊ฐ ์ปค์ง๋ฉด ์ง์ง ํฌ๊ฒ์ดํธ ์ด๋ฆฌ์์ ใ
ใ
ใ
๐ฑ
ํค๋ ํ์ผ ์๋ฐฑ ๊ฐ์ ์ปดํ์ผ ์๊ฐ์ ์ปคํผ ํ ์ ๋ง์ค ์๊ฐ์ด๊ณ , ์ด๋ฆ ์ถฉ๋์ ๋ ์ ์ด๋ ๊ฒ ์์ฃผ ๋๋์ง...
๊ทผ๋ฐ ์์ฆ์ ๋ค์์คํ์ด์ค๋ ๋ชจ๋ ์์คํ
์ ๋๋ก ์ฐ๋ฉด ์ด๋ฐ ๋ฌธ์ ๋ค ์๋น ๋ถ๋ถ ํด๊ฒฐํ ์ ์์ด!
ํนํ ๋๊ท๋ชจ ํ๋ก์ ํธ์์๋ ์ฝ๋ ๊ตฌ์กฐํ๊ฐ ์์ฐ์ฑ์ ์ข์ฐํ๋ค๊ณ ๋ด๋ ๊ณผ์ธ์ด ์๋์ผ.
์ค๋์ C++์ ๋ค์์คํ์ด์ค์ C++20๋ถํฐ ๋์
๋ ๋ชจ๋ ์์คํ
์ ํ์ฉํด์ ํ๋ก์ ํธ๋ฅผ ์ด๋ป๊ฒ ์ฒด๊ณ์ ์ผ๋ก ๊ด๋ฆฌํ ์ ์๋์ง ์ ๋๋ก ํํค์ณ๋ณผ๊ฒ ๐ฅ
๋ค์์คํ์ด์ค๋ C++98๋ถํฐ ์๋ ๊ธฐ๋ฅ์ธ๋ฐ, ์์ง๋ ๋ง์ ๊ฐ๋ฐ์๋ค์ด ์ ๋๋ก ํ์ฉ ๋ชปํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋๋ผ ใ
ใ
๊ธฐ๋ณธ ๊ฐ๋
์ ๊ฐ๋จํด. ์ฝ๋๋ฅผ ๋
ผ๋ฆฌ์ ์ธ ๊ทธ๋ฃน์ผ๋ก ๋ฌถ์ด์ ์ด๋ฆ ์ถฉ๋์ ๋ฐฉ์งํ๋ ๊ฑฐ์ง!
์ ๋ค์์คํ์ด์ค๊ฐ ํ์ํ ๊น? ๐ค
๋๊ท๋ชจ ํ๋ก์ ํธ์์๋ ์ฌ๋ฌ ํ์ด ๋์์ ์์
ํ์์?
Aํ์์ ๋ง๋ Vector ํด๋์ค๋ Bํ์์ ๋ง๋ Vector ํด๋์ค๊ฐ ์ถฉ๋ํ๋ฉด ์ง์ง ๋๊ฐํด ใ
ใ
ใ
์ด๋ด ๋ ๋ค์์คํ์ด์ค๋ก ๊ฐ์ธ์ฃผ๋ฉด ๋ฌธ์ ํด๊ฒฐ!
namespace Graphics {
class Renderer {
void draw();
};
class Shader {
void compile();
};
}
namespace Physics {
class Vector {
double x, y, z;
};
class Collision {
bool detect();
};
}
์ด๋ ๊ฒ ํ๋ฉด Graphics::Renderer๋ Physics::Vector์ฒ๋ผ ๋ช
ํํ๊ฒ ๊ตฌ๋ถํ ์ ์์ด!
๊ทผ๋ฐ ๋งค๋ฒ ์ ์ฒด ๊ฒฝ๋ก ์ฐ๊ธฐ ๊ท์ฐฎ์ผ๋ฉด using ์ ์ธ์ ์ฐ๋ฉด ๋ผ.
๋ค์์คํ์ด์ค ์ฌ์ฉ ํจํด ๐ฏ
// ๊ตฌํ ํ์ผ(.cpp)์์๋ง ์ฌ์ฉ
using namespace Graphics;
void render() {
Renderer r;
r.draw();
}
๊ตฌํ ํ์ผ ๋ด๋ถ์์๋ ํธํ๊ฒ ์จ๋ OK!
// ํค๋ ํ์ผ(.h)์์ ์ฌ์ฉ
using namespace std;
class MyClass {
vector<int> data;
};
ํค๋์์ using namespace๋ ์ฌ์์ ์์ ใ ใ
ํค๋ ํ์ผ์ using namespace ์ฐ๋ฉด ๊ทธ ํค๋๋ฅผ includeํ๋ ๋ชจ๋ ํ์ผ์ ์ํฅ์ ๋ฏธ์น๊ฑฐ๋ ?
์ด๊ฑฐ ์ง์ง ๋๋ฒ๊น
์ง์ฅ์ผ๋ก ๊ฐ๋ ์ง๋ฆ๊ธธ์ด์ผ... ๐ฑ
๊ทธ ์์ ๊ธฐ๋ฅ๋ณ๋ก ํ์ ๋ค์์คํ์ด์ค๋ฅผ ๊ตฌ์ฑํ๋ ๊ฒ ์ผ๋ฐ์ ์ด์ผ!
์: MyCompany::Graphics::Rendering::OpenGL
์ค์ฒฉ ๋ค์์คํ์ด์ค์ ์ธ๋ผ์ธ ๋ค์์คํ์ด์ค ๐ญ
C++17๋ถํฐ๋ ์ค์ฒฉ ๋ค์์คํ์ด์ค๋ฅผ ๋ ๊ฐ๊ฒฐํ๊ฒ ์ ์ธํ ์ ์์ด!
// C++17 ์ด์
namespace MyCompany {
namespace Graphics {
namespace Rendering {
class Engine { };
}
}
}
// C++17 ์ดํ - ํจ์ฌ ๊น๋!
namespace MyCompany::Graphics::Rendering {
class Engine { };
}
์ธ๋ผ์ธ ๋ค์์คํ์ด์ค๋ ๋ฒ์ ๊ด๋ฆฌํ ๋ ๊ฐ๊ฟ์ด์ผ ใ
ใ
ใ
API ๋ฒ์ ์ ๊ด๋ฆฌํ๋ฉด์๋ ํ์ ํธํ์ฑ์ ์ ์งํ ์ ์๊ฑฐ๋ !
namespace MyLib {
inline namespace v2 { // ๊ธฐ๋ณธ ๋ฒ์
class Widget {
void newFeature();
};
}
namespace v1 { // ๋ ๊ฑฐ์ ๋ฒ์
class Widget {
void oldFeature();
};
}
}
// ์ฌ์ฉํ ๋
MyLib::Widget w; // v2::Widget์ด ์๋ ์ ํ๋จ!
MyLib::v1::Widget oldW; // ๋ช
์์ ์ผ๋ก v1 ์ฌ์ฉ
์ด๋ฐ ์์ผ๋ก ํ๋ฉด ๊ธฐ์กด ์ฝ๋๋ ๊ทธ๋๋ก ๋๊ณ ์ ๋ฒ์ ์ผ๋ก ์์ฐ์ค๋ฝ๊ฒ ์ ํํ ์ ์์ด!
๋ ๊ฑฐ์ ์์คํ
์ ์ง๋ณด์ํ ๋ ์ง์ง ์ ์ฉํจ ๐
์ต๋ช ๋ค์์คํ์ด์ค - ๋ด๋ถ ๋งํฌ์ ๋ง๋ฒ โจ
์ต๋ช
๋ค์์คํ์ด์ค๋ ํ์ผ ๋ด๋ถ์์๋ง ์ฌ์ฉ๋๋ ํฌํผ ํจ์๋ ์์๋ฅผ ์ ์ํ ๋ ์ฐ๋๋ฐ,
static ํค์๋๋ณด๋ค ๋ C++์ค๋ฌ์ด ๋ฐฉ๋ฒ์ด์ผ!
// utils.cpp
namespace { // ์ต๋ช
๋ค์์คํ์ด์ค
const int BUFFER_SIZE = 1024;
void internalHelper() {
// ์ด ํ์ผ ๋ด๋ถ์์๋ง ์ฌ์ฉ
}
}
void publicFunction() {
internalHelper(); // OK!
// ๋ค๋ฅธ ํ์ผ์์๋ ์ ๊ทผ ๋ถ๊ฐ
}
์ต๋ช
๋ค์์คํ์ด์ค ์์ ๋ด์ฉ์ ์ธ๋ถ ๋งํฌ๊ฐ ์์ด์ ๋ค๋ฅธ ๋ฒ์ญ ๋จ์(translation unit)์์ ์ ๊ทผํ ์ ์์ด.
์ด๊ฒ ๋ฐ๋ก ์ง์ ํ ์บก์ํ์ง! ๐
์ ์ด์ ์ง์ง ํ๋ช
์ ์ธ ๊ธฐ๋ฅ์ธ ๋ชจ๋ ์์คํ
์๊ธฐ๋ฅผ ํด๋ณผ๊ฒ!
C++20์์ ๋๋์ด ์ ์์ผ๋ก ๋์
๋๋๋ฐ, ์ด๊ฑฐ ์ง์ง ํ๋ก์ ํธ ๋น๋ ์๊ฐ์ ํ๊ธฐ์ ์ผ๋ก ์ค์ฌ์ค ๐
์ ํต์ ์ธ ํค๋ ํ์ผ์ ๋ฌธ์ ์ ๐ค
๊ธฐ์กด C++๋ #include ๋ฐฉ์์ ์ฌ์ฉํ์์?
๊ทผ๋ฐ ์ด๊ฒ ์ง์ง ๋ฌธ์ ๊ฐ ๋ง์...
2๏ธโฃ ๋งคํฌ๋ก ์ค์ผ: ํค๋์ ๋งคํฌ๋ก๊ฐ ์ ์ญ์ผ๋ก ํผ์ง
3๏ธโฃ ์ํ ์์กด์ฑ: ํค๋ ๊ฐ ์ํธ ์ฐธ์กฐ๋ก ์ธํ ๋ณต์ก๋ ์ฆ๊ฐ
4๏ธโฃ ๋๋ฆฐ ๋น๋: ๋ํ ํ๋ก์ ํธ์์ ์ปดํ์ผ ์๊ฐ ํญ์ฆ
5๏ธโฃ ๋ถ๋ช ํํ ์ธํฐํ์ด์ค: ๋ฌด์์ด ๊ณต๊ฐ API์ธ์ง ํ์ ์ด๋ ค์
์๋ฅผ ๋ค์ด๋ณผ๊ฒ. <iostream> ํ๋๋ง includeํด๋ ์๋ง ์ค์ ์ฝ๋๊ฐ ํ์ฑ๋๊ฑฐ๋ ?
์ด๊ฒ 100๊ฐ ํ์ผ์์ include๋๋ฉด... ์์๋ง ํด๋ ๋์ฐ ใ
ใ
ใ
๋ชจ๋์ด ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ ๐ช
๋ชจ๋์ ์ด๋ฐ ๋ฌธ์ ๋ค์ ๊ทผ๋ณธ์ ์ผ๋ก ํด๊ฒฐํด!
ํ ๋ฒ ์ปดํ์ผ๋ ๋ชจ๋์ ๋ฐ์ด๋๋ฆฌ ํํ๋ก ์ ์ฅ๋๊ณ , ๋ค๋ฅธ ๊ณณ์์ importํ ๋๋ ๊ทธ๋ฅ ๊ฐ์ ธ๋ค ์ฐ๊ธฐ๋ง ํ๋ฉด ๋ผ.
// math_utils.ixx (๋ชจ๋ ์ธํฐํ์ด์ค ํ์ผ)
export module math_utils; // ๋ชจ๋ ์ ์ธ
export namespace MathUtils {
int add(int a, int b) {
return a + b;
}
int multiply(int a, int b) {
return a * b;
}
}
// ๋ด๋ถ ๊ตฌํ (export ์ ๋ถ์ด๋ฉด ๋น๊ณต๊ฐ)
namespace {
int internalHelper() {
return 42;
}
}
// main.cpp
import math_utils; // #include ๋์ import!
int main() {
int result = MathUtils::add(10, 20);
// internalHelper()๋ ์ ๊ทผ ๋ถ๊ฐ - ์บก์ํ ์๋ฒฝ!
return 0;
}
๋ณด์ด์ง? #include ๋์ import๋ฅผ ์ฐ๊ณ ,
export ํค์๋๋ก ๊ณต๊ฐํ ๊ฒ๋ง ๋ช
์์ ์ผ๋ก ์ ํํ ์ ์์ด!
์ด๊ฒ ๋ฐ๋ก ๋ช
ํํ ์ธํฐํ์ด์ค ์ ์์ผ! ๐ฏ
๋ชจ๋์ ํต์ฌ ๊ฐ๋ ๋ค ๐
1๏ธโฃ ๋ชจ๋ ์ธํฐํ์ด์ค ์ ๋ (Module Interface Unit)
export module๋ก ์์ํ๋ ํ์ผ์ด์ผ.
์ธ๋ถ์ ๊ณต๊ฐํ ์ธํฐํ์ด์ค๋ฅผ ์ ์ํ๋ ๊ณณ์ด์ง!
2๏ธโฃ ๋ชจ๋ ๊ตฌํ ์ ๋ (Module Implementation Unit)
module๋ก ์์ํ๋ ํ์ผ.
๋ด๋ถ ๊ตฌํ์ ๋ด๋นํ๊ณ , export ์์ด ์์ฑํด.
3๏ธโฃ ๋ชจ๋ ํํฐ์
(Module Partition)
ํฐ ๋ชจ๋์ ์ฌ๋ฌ ํ์ผ๋ก ๋๋ ๋ ์ฌ์ฉ!
์ด๊ฑฐ ์ง์ง ๋๊ท๋ชจ ํ๋ก์ ํธ์์ ํ์์ผ ใ
ใ
// graphics-rendering.ixx (ํํฐ์
)
export module graphics:rendering;
export class Renderer {
void draw();
};
// graphics-shaders.ixx (ํํฐ์
)
export module graphics:shaders;
export class Shader {
void compile();
};
// graphics.ixx (๋ฉ์ธ ๋ชจ๋)
export module graphics;
export import :rendering; // ํํฐ์
์ฌ๊ณต๊ฐ
export import :shaders;
// main.cpp
import graphics; // ๋ชจ๋ ํํฐ์
์๋ ํฌํจ!
Renderer r;
Shader s;
ํํฐ์
์ ์ฐ๋ฉด ๋ชจ๋์ ๋
ผ๋ฆฌ์ ์ผ๋ก ๋ถํ ํ๋ฉด์๋ ์ธ๋ถ์์๋ ํ๋์ ๋ชจ๋์ฒ๋ผ ์ฌ์ฉํ ์ ์์ด!
์ด๊ฒ ๋ฐ๋ก ๋ชจ๋์ฑ๊ณผ ํธ์์ฑ์ ์๋ฒฝํ ์กฐํ ๐
์ ์ญ ๋ชจ๋ ํ๋๊ทธ๋จผํธ ๐
๋ ๊ฑฐ์ ํค๋๋ ๋ชจ๋์ ํจ๊ป ์จ์ผ ํ ๋๊ฐ ์์์?
๊ทธ๋ด ๋ ์ ์ญ ๋ชจ๋ ํ๋๊ทธ๋จผํธ๋ฅผ ์ฌ์ฉํด!
module; // ์ ์ญ ๋ชจ๋ ํ๋๊ทธ๋จผํธ ์์
// ์ฌ๊ธฐ์๋ ์ ํต์ ์ธ #include ์ฌ์ฉ ๊ฐ๋ฅ
#include <vector>
#include <string>
#include "legacy_header.h"
export module my_module; // ์ค์ ๋ชจ๋ ์์
export class MyClass {
std::vector<std::string> data;
// legacy_header.h์ ํ์
๋ ์ฌ์ฉ ๊ฐ๋ฅ
};
์ด๋ ๊ฒ ํ๋ฉด ๋ ๊ฑฐ์ ์ฝ๋์์ ํธํ์ฑ์ ์ ์งํ๋ฉด์ ์ ์ง์ ์ผ๋ก ๋ชจ๋๋ก ์ ํํ ์ ์์ด!
์ค๋ฌด์์ ์ง์ง ์ ์ฉํ ๊ธฐ๋ฅ์ด์ผ ๐ฏ
์ ์ด์ ์ค์ ์ด์ผ!
๋ค์์คํ์ด์ค๋ ๋ชจ๋์ ์ด๋ป๊ฒ ์กฐํฉํด์ ๋๊ท๋ชจ ํ๋ก์ ํธ๋ฅผ ๊ตฌ์กฐํํ ์ง ์์๋ณด์ ๐ฏ
๊ณ์ธต์ ๊ตฌ์กฐ ์ค๊ณ ์์น ๐
ํ๋ก์ ํธ ๊ตฌ์กฐ๋ ๋๋ฉ์ธ ์ฃผ๋ ์ค๊ณ(DDD) ์์น์ ๋ฐ๋ฅด๋ ๊ฒ ์ข์.
๋น์ฆ๋์ค ๋ก์ง์ ์ค์ฌ์ผ๋ก ๋ชจ๋์ ๋๋๋ ๊ฑฐ์ง!
MyGameEngine/
โโโ Core/
โ โโโ core.ixx (export module engine.core)
โ โโโ memory.ixx (export module engine.core:memory)
โ โโโ threading.ixx (export module engine.core:threading)
โโโ Graphics/
โ โโโ graphics.ixx (export module engine.graphics)
โ โโโ rendering.ixx (ํํฐ์
)
โ โโโ shaders.ixx (ํํฐ์
)
โ โโโ textures.ixx (ํํฐ์
)
โโโ Physics/
โ โโโ physics.ixx (export module engine.physics)
โ โโโ collision.ixx (ํํฐ์
)
โ โโโ dynamics.ixx (ํํฐ์
)
โโโ Audio/
โโโ audio.ixx (export module engine.audio)
โโโ mixer.ixx (ํํฐ์
)
๊ฐ ๋ชจ๋ ์์์๋ ๋ค์์คํ์ด์ค๋ก ์ถ๊ฐ ๊ตฌ์กฐํ๋ฅผ ํด์ฃผ๋ ๊ฑฐ์ผ!
// graphics.ixx
export module engine.graphics;
export namespace Engine::Graphics {
namespace Rendering {
class Renderer { };
class Pipeline { };
}
namespace Shaders {
class ShaderProgram { };
class ShaderCompiler { };
}
namespace Textures {
class Texture2D { };
class TextureCache { };
}
}
์ด๋ ๊ฒ ํ๋ฉด Engine::Graphics::Rendering::Renderer์ฒ๋ผ
๋ช
ํํ ๊ณ์ธต ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๋ฉด์๋ ๋ชจ๋์ ๋น ๋ฅธ ์ปดํ์ผ ์๋๋ฅผ ๋๋ฆด ์ ์์ด! ๐
์์กด์ฑ ๊ด๋ฆฌ ์ ๋ต ๐
๋๊ท๋ชจ ํ๋ก์ ํธ์์ ๊ฐ์ฅ ์ค์ํ ๊ฒ ์์กด์ฑ ๊ด๋ฆฌ์ผ.
์ํ ์์กด์ฑ์ ์ง์ง ํ๋ก์ ํธ๋ฅผ ๋ง์น๋ ์ง๋ฆ๊ธธ์ด๊ฑฐ๋ ใ
ใ
ใ
2๏ธโฃ ์ธํฐํ์ด์ค ๋ถ๋ฆฌ: ํฐ ๋ชจ๋์ ์์ ์ธํฐํ์ด์ค๋ก ๋ถํ
3๏ธโฃ ์์กด์ฑ ์ญ์ : ๊ตฌ์ฒด ํด๋์ค ๋์ ์ถ์ ์ธํฐํ์ด์ค์ ์์กด
4๏ธโฃ ์ํ ์ ๊ฑฐ: ๋ชจ๋ ๊ฐ ์ํ ์ฐธ์กฐ ์ ๋ ๊ธ์ง!
// ๊ณ์ธต์ ์์กด์ฑ (OK!)
Application Layer
โ (์์กด)
Business Logic Layer
โ (์์กด)
Data Access Layer
โ (์์กด)
Core Utilities
// ๊ฐ ๋ ์ด์ด๋ ๋ชจ๋๋ก ๊ตฌํ
export module app.ui;
import app.business; // ํ์ ๋ ์ด์ด๋ง import
export module app.business;
import app.data; // ํ์ ๋ ์ด์ด๋ง import
export module app.data;
import app.core; // ์ตํ์ ๋ ์ด์ด
// ์ด๋ฌ๋ฉด ์ ๋ผ!
export module graphics;
import physics; // Graphics๊ฐ Physics ์์กด
export module physics;
import graphics; // Physics๊ฐ Graphics ์์กด
// โ ์ํ ์์กด์ฑ ๋ฐ์! ์ปดํ์ผ ์๋ฌ!
์ด๋ฐ ๊ฒฝ์ฐ ๊ณตํต ์ธํฐํ์ด์ค ๋ชจ๋์ ๋ง๋ค์ด์ ํด๊ฒฐํด์ผ ํด!
์ํ ์์กด์ฑ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๊ฐ๋จํด.
๊ณตํต ์ธํฐํ์ด์ค๋ฅผ ๋ณ๋ ๋ชจ๋๋ก ๋ถ๋ฆฌํ๋ ๊ฑฐ์ง!
// common.ixx - ๊ณตํต ์ธํฐํ์ด์ค
export module engine.common;
export namespace Engine {
class IRenderable { // ์ธํฐํ์ด์ค
virtual void render() = 0;
};
}
// graphics.ixx
export module engine.graphics;
import engine.common;
export namespace Engine::Graphics {
class Renderer {
void draw(IRenderable* obj);
};
}
// physics.ixx
export module engine.physics;
import engine.common;
export namespace Engine::Physics {
class PhysicsObject : public IRenderable {
void render() override;
};
}
์ด์ Graphics๋ Physics๊ฐ ์๋ก ์ง์ ์์กดํ์ง ์๊ณ ,
๊ณตํต ์ธํฐํ์ด์ค๋ฅผ ํตํด ํต์ ํ๊ฒ ๋ผ!
์ด๊ฒ ๋ฐ๋ก ์์กด์ฑ ์ญ์ ์์น(DIP)์ ์ค์ ์ ์ฉ์ด์ผ ๐ช
๋น๋ ์์คํ ํตํฉ ๐ ๏ธ
๋ชจ๋์ ์ค์ ๋ก ์ฐ๋ ค๋ฉด ๋น๋ ์์คํ
์ค์ ์ด ์ค์ํด!
์ฃผ์ ๋น๋ ์์คํ
๋ณ๋ก ์ด๋ป๊ฒ ์ค์ ํ๋์ง ์์๋ณด์.
CMake ์ค์ (๊ฐ์ฅ ๋ง์ด ์!)
# CMakeLists.txt
cmake_minimum_required(VERSION 3.28) # ๋ชจ๋ ์ง์ ๋ฒ์
project(MyProject CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ๋ชจ๋ ์ง์ ํ์ฑํ
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP ON)
# ๋ชจ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
add_library(graphics)
target_sources(graphics
PUBLIC
FILE_SET CXX_MODULES FILES
graphics.ixx
rendering.ixx
shaders.ixx
)
# ์คํ ํ์ผ
add_executable(game main.cpp)
target_link_libraries(game PRIVATE graphics)
CMake 3.28๋ถํฐ ๋ชจ๋์ ์ ๋๋ก ์ง์ํ๋๋ฐ,
์์ง ์คํ์ ๊ธฐ๋ฅ์ด๋ผ ์ค์ ์ด ์ข ๋ณต์กํด ใ
ใ
ํ์ง๋ง ์ ์ ๊ฐ์ ๋๊ณ ์์ผ๋ ๊ธฐ๋ํด๋ ์ข์!
Visual Studio ์ค์
VS 2022๋ถํฐ๋ ๋ชจ๋์ GUI์์ ์ฝ๊ฒ ์ค์ ํ ์ ์์ด!
ํ๋ก์ ํธ ์์ฑ โ C/C++ โ Language โ Enable C++ Modules๋ฅผ Yes๋ก ์ค์ ํ๋ฉด ๋ ใ
ใ
Clang/GCC ์ค์
# Clang (libc++ ์ฌ์ฉ)
clang++ -std=c++20 -stdlib=libc++ -fmodules \
--precompile graphics.ixx -o graphics.pcm
clang++ -std=c++20 -stdlib=libc++ -fmodules \
-fmodule-file=graphics.pcm main.cpp graphics.pcm -o game
# GCC (์์ง ๋ถ๋ถ ์ง์)
g++ -std=c++20 -fmodules-ts \
-xc++-system-header iostream
g++ -std=c++20 -fmodules-ts \
graphics.ixx main.cpp -o game
์ปดํ์ผ๋ฌ๋ง๋ค ๋ชจ๋ ์ง์ ์์ค์ด ๋ค๋ฅด๋๊น,
ํ๋ก์ ํธ ์์ ์ ์ ํ๊ฒ ์ปดํ์ผ๋ฌ์ ๋ชจ๋ ์ง์ ์ํ๋ฅผ ํ์ธํ๋ ๊ฒ ์ค์ํด! ๐ฏ
์ด๋ก ์ ์ถฉ๋ถํ ๋ดค์ผ๋ ์ด์ ์ค์ ํ๋ค์ ๊ณต์ ํ ๊ฒ!
์ค์ ํ๋ก์ ํธ์์ ์จ๋จน์ ์ ์๋ ๊ฟํ๋ค์ด์ผ ๐ฏ
์ปดํ์ผ ์๊ฐ ์ต์ ํ ์ ๋ต โก
๋ชจ๋์ ๊ฐ์ฅ ํฐ ์ฅ์ ์ด ๋น ๋ฅธ ์ปดํ์ผ์ธ๋ฐ,
์ ๋๋ก ํ์ฉ ์ ํ๋ฉด ์คํ๋ ค ๋๋ ค์ง ์๋ ์์ด ใ
ใ
ใ
2๏ธโฃ ํํฐ์ ์ ๊ทน ํ์ฉ: ๋ณ๊ฒฝ ๋น๋์ ๋ฐ๋ผ ํํฐ์ ๋ถ๋ฆฌ
3๏ธโฃ ์ ๋ฐฉ ์ ์ธ ํ์ฉ: ๋ถํ์ํ import ์ค์ด๊ธฐ
4๏ธโฃ ํ๋ฆฌ์ปดํ์ผ๋ ๋ชจ๋: ์์ฃผ ์ฐ๋ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฏธ๋ฆฌ ์ปดํ์ผ
5๏ธโฃ ๋ณ๋ ฌ ๋น๋: ๋ ๋ฆฝ์ ์ธ ๋ชจ๋์ ๋์ ์ปดํ์ผ
์ ํต์ ํค๋ ๋ฐฉ์:
- ํ ๋น๋: 8๋ถ 30์ด
- ์ฆ๋ถ ๋น๋: 45์ด
- ํค๋ ๋ณ๊ฒฝ ์: 3๋ถ 20์ด
๋ชจ๋ ๋ฐฉ์:
- ํ ๋น๋: 3๋ถ 10์ด (63% ๊ฐ์ ! ๐)
- ์ฆ๋ถ ๋น๋: 12์ด (73% ๊ฐ์ !)
- ๋ชจ๋ ๋ณ๊ฒฝ ์: 25์ด (87% ๊ฐ์ !)
โ ํนํ ์ฆ๋ถ ๋น๋์์ ์๋์ ์ฐจ์ด!
์ค์ ๋ก ๋๊ท๋ชจ ํ๋ก์ ํธ์์ ๋ชจ๋ ๋์
ํ ๊ฐ๋ฐ ์์ฐ์ฑ์ด ์์ฒญ ์ฌ๋ผ๊ฐ๋ค๋ ํ๊ธฐ๊ฐ ๋ง์!
์ปดํ์ผ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ์ ์ปคํผ ๋ง์๋ฌ ๊ฐ ํ์๊ฐ ์์ด์ง ๊ฑฐ์ง ใ
ใ
ใ
โ
๋ชจ๋ ์ธํฐํ์ด์ค ์ค๊ณ ์์น ๐จ
๋ชจ๋์ ๊ณต๊ฐ ์ธํฐํ์ด์ค๋ ์ ์คํ๊ฒ ์ค๊ณํด์ผ ํด.
ํ ๋ฒ ๊ณต๊ฐํ๋ฉด ๋ฐ๊พธ๊ธฐ ์ด๋ ต๊ฑฐ๋ !
export module database;
// 1. ๋ช
ํํ ๋ค์์คํ์ด์ค
export namespace DB {
// 2. ์ถ์ ์ธํฐํ์ด์ค ์ ๊ณต
class IConnection {
public:
virtual ~IConnection() = default;
virtual bool connect(const std::string& url) = 0;
virtual void disconnect() = 0;
};
// 3. ํฉํ ๋ฆฌ ํจ์๋ก ๊ตฌํ ์จ๊ธฐ๊ธฐ
std::unique_ptr<IConnection> createConnection(
const std::string& type
);
// 4. ํ์ํ ํ์
๋ง ๊ณต๊ฐ
enum class ConnectionType {
MySQL, PostgreSQL, SQLite
};
// 5. ์ ํธ๋ฆฌํฐ ํจ์
std::string escapeString(const std::string& str);
}
// ๋ด๋ถ ๊ตฌํ์ export ์ ํจ (์บก์ํ!)
namespace DB::Internal {
class MySQLConnection : public IConnection {
// ๊ตฌํ ์ธ๋ถ์ฌํญ
};
}
์ด๋ ๊ฒ ํ๋ฉด ๋ด๋ถ ๊ตฌํ์ ์์ ๋กญ๊ฒ ๋ฐ๊ฟ๋ ์ธ๋ถ ์ฝ๋๋ ์ํฅ ์ ๋ฐ์!
์ด๊ฒ ๋ฐ๋ก ์ง์ ํ ์ ๋ณด ์๋์ด์ง ๐
๋ค์์คํ์ด์ค ๋ณ์นญ๊ณผ using ์ ์ธ ํ์ฉ ๐ท๏ธ
๊ธด ๋ค์์คํ์ด์ค ๊ฒฝ๋ก๋ ๋ณ์นญ์ผ๋ก ์งง๊ฒ ๋ง๋ค ์ ์์ด!
// ๋ค์์คํ์ด์ค ๋ณ์นญ
namespace GFX = MyCompany::GameEngine::Graphics::Rendering;
GFX::Renderer renderer; // ํจ์ฌ ๊ฐ๊ฒฐ!
// using ์ ์ธ (ํน์ ํ์
๋ง)
using MyCompany::GameEngine::Physics::Vector3D;
Vector3D position; // ๋ค์์คํ์ด์ค ์๋ต
// using ์ง์๋ฌธ (๋ก์ปฌ ์ค์ฝํ์์๋ง!)
void render() {
using namespace MyCompany::GameEngine::Graphics;
// ์ด ํจ์ ์์์๋ง ์ ์ฉ
Renderer r;
Shader s;
}
๋ณ์นญ์ ํนํ ํ ํ๋ฆฟ ํ์ ๋ค๋ฃฐ ๋ ๊ฐ๊ฟ์ด์ผ ใ ใ
// ๋ณต์กํ ํ
ํ๋ฆฟ ํ์
๋ณ์นญ
namespace Utils {
template<typename T>
using SharedPtr = std::shared_ptr<T>;
template<typename K, typename V>
using HashMap = std::unordered_map<K, V>;
}
Utils::SharedPtr<Player> player;
Utils::HashMap<int, std::string> idToName;
์ด๋ฐ ์์ผ๋ก ํ๋ก์ ํธ ์ ์ฒด์์ ์ผ๊ด๋ ํ์
๋ณ์นญ์ ์ฐ๋ฉด
๋์ค์ ๊ตฌํ ๋ฐ๊พธ๊ธฐ๋ ์ฝ๊ณ ๊ฐ๋
์ฑ๋ ์ข์์ ธ! ๐
ํค๋ ์ ๋ - ๋ ๊ฑฐ์ ์ฝ๋์์ ๋ค๋ฆฌ ๐
๊ธฐ์กด ํค๋ ํ์ผ์ ๋ชจ๋์ฒ๋ผ importํ ์ ์๋ ๊ธฐ๋ฅ์ด ์์ด!
์ด๊ฒ ๋ฐ๋ก ํค๋ ์ ๋(Header Unit)์ด์ผ.
// ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํค๋๋ฅผ ๋ชจ๋์ฒ๋ผ import
import <iostream>;
import <vector>;
import <string>;
// ์ ํต์ ์ธ #include๋ณด๋ค ๋น ๋ฆ!
int main() {
std::vector<std::string> names;
std::cout << "Hello Module!\n";
}
ํค๋ ์ ๋์ ์์ ํ ๋ชจ๋์ ์๋์ง๋ง,
์ปดํ์ผ ์๋ ํฅ์ ํจ๊ณผ๋ ํ์คํ ์์ด!
๋ ๊ฑฐ์ ํ๋ก์ ํธ๋ฅผ ์ ์ง์ ์ผ๋ก ๋ชจ๋ํํ ๋ ์ ์ฉํ์ง โจ
์ด๋ก ๋ง ๋ณด๋ฉด ์ฌ๋ฏธ์์ผ๋๊น ์ค์ ๊ฒ์ ์์ง ๊ตฌ์กฐ๋ฅผ ์์๋ก ๋ค์ด๋ณผ๊ฒ!
์ง์ง ํ๋ก์ ํธ์์ ์ด๋ป๊ฒ ์ ์ฉํ๋์ง ๋ณด์ฌ์ค๊ฒ ๐ฎ
๊ฒ์ ์์ง ๋ชจ๋ ๊ตฌ์กฐ ์ค๊ณ ๐ฎ
AwesomeEngine/
โโโ Core/
โ โโโ core.ixx (๋ฉ์ธ ๋ชจ๋)
โ โโโ core-memory.ixx (๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ)
โ โโโ core-threading.ixx (๋ฉํฐ์ค๋ ๋ฉ)
โ โโโ core-math.ixx (์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ)
โโโ Platform/
โ โโโ platform.ixx (ํ๋ซํผ ์ถ์ํ)
โ โโโ platform-windows.ixx (Windows ๊ตฌํ)
โ โโโ platform-linux.ixx (Linux ๊ตฌํ)
โโโ Graphics/
โ โโโ graphics.ixx (๊ทธ๋ํฝ์ค ๋ฉ์ธ)
โ โโโ graphics-renderer.ixx (๋ ๋๋ฌ)
โ โโโ graphics-shader.ixx (์
ฐ์ด๋)
โ โโโ graphics-texture.ixx (ํ
์ค์ฒ)
โโโ Physics/
โ โโโ physics.ixx (๋ฌผ๋ฆฌ ์์ง)
โ โโโ physics-collision.ixx (์ถฉ๋ ๊ฐ์ง)
โ โโโ physics-dynamics.ixx (๋์ญํ)
โโโ Game/
โโโ game.ixx (๊ฒ์ ๋ก์ง)
โโโ game-entities.ixx (์ํฐํฐ ์์คํ
)
๊ฐ ๋ชจ๋์ ํ๋์ฉ ๊ตฌํํด๋ณด์!
1๏ธโฃ Core ๋ชจ๋ - ์์ง์ ์ฌ์ฅ ๐
// core-math.ixx
export module engine.core:math;
export namespace Engine::Core::Math {
struct Vector3 {
float x, y, z;
Vector3 operator+(const Vector3& other) const {
return {x + other.x, y + other.y, z + other.z};
}
float length() const {
return std::sqrt(x*x + y*y + z*z);
}
};
struct Matrix4x4 {
float data[16];
Matrix4x4 operator*(const Matrix4x4& other) const;
Vector3 transform(const Vector3& v) const;
};
// ์ ํธ๋ฆฌํฐ ํจ์๋ค
float lerp(float a, float b, float t);
Vector3 normalize(const Vector3& v);
}
// core.ixx (๋ฉ์ธ ๋ชจ๋)
export module engine.core;
export import :math;
export import :memory;
export import :threading;
export namespace Engine::Core {
// ์์ง ์ด๊ธฐํ
class Engine {
public:
static Engine& instance();
bool initialize();
void shutdown();
void update(float deltaTime);
private:
Engine() = default;
bool isInitialized = false;
};
}
2๏ธโฃ Graphics ๋ชจ๋ - ํ๋ คํ ๋น์ฃผ์ผ โจ
// graphics-renderer.ixx
export module engine.graphics:renderer;
import engine.core;
export namespace Engine::Graphics {
class Renderer {
public:
virtual ~Renderer() = default;
virtual bool initialize() = 0;
virtual void beginFrame() = 0;
virtual void endFrame() = 0;
virtual void draw(const Mesh& mesh) = 0;
};
// ํฉํ ๋ฆฌ ํจํด
enum class RendererAPI {
OpenGL, Vulkan, DirectX12
};
std::unique_ptr<Renderer> createRenderer(
RendererAPI api
);
}
// ๋ด๋ถ ๊ตฌํ (export ์ ํจ)
namespace Engine::Graphics::Internal {
class OpenGLRenderer : public Renderer {
// OpenGL ๊ตฌํ
};
class VulkanRenderer : public Renderer {
// Vulkan ๊ตฌํ
};
}
3๏ธโฃ Physics ๋ชจ๋ - ํ์ค์ ์ธ ๋ฌผ๋ฆฌ ๐
// physics.ixx
export module engine.physics;
import engine.core;
export namespace Engine::Physics {
class RigidBody {
public:
void applyForce(const Core::Math::Vector3& force);
void applyImpulse(const Core::Math::Vector3& impulse);
Core::Math::Vector3 getVelocity() const;
void setVelocity(const Core::Math::Vector3& v);
private:
Core::Math::Vector3 velocity{0, 0, 0};
Core::Math::Vector3 acceleration{0, 0, 0};
float mass = 1.0f;
};
class PhysicsWorld {
public:
void addRigidBody(RigidBody* body);
void removeRigidBody(RigidBody* body);
void simulate(float deltaTime);
private:
std::vector<RigidBody*> bodies;
Core::Math::Vector3 gravity{0, -9.81f, 0};
};
}
4๏ธโฃ Game ๋ชจ๋ - ์ค์ ๊ฒ์ ๋ก์ง ๐ฒ
// game.ixx
export module engine.game;
import engine.core;
import engine.graphics;
import engine.physics;
export namespace Engine::Game {
class GameObject {
public:
virtual ~GameObject() = default;
virtual void update(float deltaTime) = 0;
virtual void render(Graphics::Renderer& renderer) = 0;
Core::Math::Vector3 position{0, 0, 0};
Core::Math::Vector3 rotation{0, 0, 0};
Core::Math::Vector3 scale{1, 1, 1};
};
class Player : public GameObject {
public:
void update(float deltaTime) override {
// ํ๋ ์ด์ด ๋ก์ง
handleInput();
updatePhysics(deltaTime);
}
void render(Graphics::Renderer& renderer) override {
// ํ๋ ์ด์ด ๋ ๋๋ง
}
private:
void handleInput();
void updatePhysics(float deltaTime);
Physics::RigidBody* rigidBody = nullptr;
float moveSpeed = 5.0f;
};
class GameWorld {
public:
void addGameObject(std::unique_ptr<GameObject> obj);
void update(float deltaTime);
void render(Graphics::Renderer& renderer);
private:
std::vector<std::unique_ptr<GameObject>> objects;
Physics::PhysicsWorld physicsWorld;
};
}
5๏ธโฃ ๋ฉ์ธ ์ ํ๋ฆฌ์ผ์ด์ ๐
// main.cpp
import engine.core;
import engine.graphics;
import engine.physics;
import engine.game;
import <iostream>;
import <memory>;
int main() {
using namespace Engine;
// ์์ง ์ด๊ธฐํ
auto& engine = Core::Engine::instance();
if (!engine.initialize()) {
std::cerr << "Failed to initialize engine!\n";
return -1;
}
// ๋ ๋๋ฌ ์์ฑ
auto renderer = Graphics::createRenderer(
Graphics::RendererAPI::Vulkan
);
renderer->initialize();
// ๊ฒ์ ์๋ ์์ฑ
Game::GameWorld world;
// ํ๋ ์ด์ด ์ถ๊ฐ
auto player = std::make_unique<Game::Player>();
player->position = {0, 0, 0};
world.addGameObject(std::move(player));
// ๊ฒ์ ๋ฃจํ
float deltaTime = 0.016f; // 60 FPS
bool running = true;
while (running) {
renderer->beginFrame();
world.update(deltaTime);
world.render(*renderer);
renderer->endFrame();
engine.update(deltaTime);
}
engine.shutdown();
return 0;
}
๋ณด์ด์ง? ๋ชจ๋ ๋๋ถ์ ๊ฐ ์์คํ
์ด ๊น๋ํ๊ฒ ๋ถ๋ฆฌ๋๊ณ ,
์์กด์ฑ๋ ๋ช
ํํ๊ฒ ๋๋ฌ๋์์!
์ด๊ฒ ๋ฐ๋ก ๋๊ท๋ชจ ํ๋ก์ ํธ ๊ตฌ์กฐํ์ ์ ์์ด์ผ ๐ฏ
์ค์ ํ: ์ ์ง์ ๋ชจ๋ ๋์ ์ ๋ต ๐
๊ธฐ์กด ํ๋ก์ ํธ์ ๊ฐ์๊ธฐ ๋ชจ๋ ๋์
ํ๋ฉด ํผ๋์ค๋ฌ์ธ ์ ์์ด.
๋จ๊ณ์ ์ผ๋ก ์ ๊ทผํ๋ ๊ฒ ํ๋ช
ํด!
- ์ปดํ์ผ๋ฌ ๋ชจ๋ ์ง์ ํ์ธ
- ๋น๋ ์์คํ ์ ๊ทธ๋ ์ด๋
- ํ์ ๊ต์ก ๋ฐ ๊ฐ์ด๋๋ผ์ธ ์์ฑ
2๋จ๊ณ: ํ์ผ๋ฟ (2-4์ฃผ)
- ๋ ๋ฆฝ์ ์ธ ์ ํธ๋ฆฌํฐ ๋ชจ๋๋ถํฐ ์์
- ์์ ๋ชจ๋๋ก ๊ฒฝํ ์๊ธฐ
- ๋ฌธ์ ์ ํ์ ๋ฐ ํด๊ฒฐ
3๋จ๊ณ: ํ์ฅ (1-3๊ฐ์)
- ํต์ฌ ๋ชจ๋ ์ ํ
- ์์กด์ฑ ๊ทธ๋ํ ์ ๋ฆฌ
- ๋ ๊ฑฐ์ ์ฝ๋์ ๊ณต์กด
4๋จ๊ณ: ์์ฑ (3-6๊ฐ์)
- ์ ์ฒด ํ๋ก์ ํธ ๋ชจ๋ํ
- ์ฑ๋ฅ ์ต์ ํ
- ๋ฌธ์ํ ๋ฐ ๋ฒ ์คํธ ํ๋ํฐ์ค ์ ๋ฆฝ
๊ธํ๊ฒ ํ์ง ๋ง๊ณ ์ฒ์ฒํ ์์ ์ ์ผ๋ก ์ ํํ๋ ๊ฒ ์ค์ํด!
ํนํ ์์ฉ ํ๋ก์ ํธ๋ผ๋ฉด ๋๋์ฑ ์ ์คํด์ผ ํ์ง โ ๏ธ
๋๋ฒ๊น ๊ณผ ํธ๋ฌ๋ธ์ํ ๐ง
๋ชจ๋ ์ฐ๋ค ๋ณด๋ฉด ๊ฐ๋ ์ด์ํ ์๋ฌ ๋ง๋ ๋ ์์ด ใ
ใ
์์ฃผ ๋์ค๋ ๋ฌธ์ ๋ค๊ณผ ํด๊ฒฐ๋ฒ์ ์ ๋ฆฌํด๋ดค์ด!
โ ๋ชจ๋ ํ์ผ ๊ฒฝ๋ก ํ์ธ, ๋น๋ ์์ ์ฒดํฌ
2. "conflicting module declaration" ์๋ฌ
โ ๊ฐ์ ๋ชจ๋์ ์ฌ๋ฌ ํ์ผ์์ ์ ์ธํ๋์ง ํ์ธ
3. "cannot import in global module fragment" ์๋ฌ
โ module; ์ ์ธ ์ ์๋ #include๋ง ๊ฐ๋ฅ
4. ๋ง์ปค ์๋ฌ (undefined reference)
โ export ํค์๋ ๋น ๋จ๋ ธ๋์ง ํ์ธ
โ ๋ชจ๋ ๊ตฌํ ํ์ผ์ด ๋น๋์ ํฌํจ๋๋์ง ํ์ธ
5. ์ํ import ์๋ฌ
โ ๋ชจ๋ ์์กด์ฑ ๊ทธ๋ํ ๋ค์ ์ค๊ณ ํ์
๋๋ฒ๊น
ํ ๋๋ ์ปดํ์ผ๋ฌ ๋ก๊ทธ๋ฅผ ์์ธํ ๋ด์ผ ํด!
๋ชจ๋ ๊ด๋ จ ์๋ฌ ๋ฉ์์ง๊ฐ ์์ง์ ์ข ๋ถ์น์ ํ ํธ์ด๊ฑฐ๋ ใ
ใ
C++ ๋ชจ๋์ ๋ฏธ๋ ๐ฎ
C++20์์ ๋ชจ๋์ด ๋์
๋์ง๋ง ์์ง ์ด๊ธฐ ๋จ๊ณ์ผ.
์์ผ๋ก ๋ ๋ฐ์ ํ ๋ถ๋ถ๋ค์ด ๋ง์!
์์๋๋ ๋ฐ์ ๋ฐฉํฅ:
1๏ธโฃ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ชจ๋ํ
C++23๋ถํฐ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฒด๊ฐ ๋ชจ๋๋ก ์ ๊ณต๋ ์์ ์ด์ผ!
import std; ํ ์ค์ด๋ฉด ๋ชจ๋ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ ๊ฐ๋ฅ ใ
ใ
// C++23 ์ดํ
import std; // ๋ชจ๋ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ!
int main() {
std::vector<int> v = {1, 2, 3};
std::cout << "Hello!\n";
// iostream, vector ๋ฑ ๋ชจ๋ ์ฌ์ฉ ๊ฐ๋ฅ
}
2๏ธโฃ ๋น๋ ์์คํ
ํตํฉ ๊ฐ์
CMake, Meson ๋ฑ ์ฃผ์ ๋น๋ ์์คํ
์ ๋ชจ๋ ์ง์์ด ๊ณ์ ๊ฐ์ ๋๊ณ ์์ด.
๊ณง ์ค์ ์ด ํจ์ฌ ๊ฐ๋จํด์ง ๊ฑฐ์ผ!
3๏ธโฃ IDE ์ง์ ๊ฐํ
Visual Studio, CLion, VS Code ๋ฑ์์ ๋ชจ๋ ์๋์์ฑ, ๋ฆฌํฉํ ๋ง ๊ธฐ๋ฅ์ด ๊ฐํ๋ ์์ !
๊ฐ๋ฐ ๊ฒฝํ์ด ํจ์ฌ ์ข์์ง ๊ฑฐ๋ผ๊ณ ๋ด โจ
4๏ธโฃ ํจํค์ง ๊ด๋ฆฌ์ ํตํฉ
vcpkg, Conan ๊ฐ์ ํจํค์ง ๊ด๋ฆฌ์๊ฐ ๋ชจ๋์ ๋ค์ดํฐ๋ธ๋ก ์ง์ํ๊ฒ ๋ ๊ฑฐ์ผ.
์๋ํํฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ์ด ๋ ํธํด์ง๊ฒ ์ง!
ํ์ต ๋ฆฌ์์ค์ ์ปค๋ฎค๋ํฐ ๐
๋ชจ๋ ๊ณต๋ถํ๊ณ ์ถ๋ค๋ฉด ์ด๋ฐ ๋ฆฌ์์ค๋ค ์ถ์ฒํด!
- cppreference.com์ ๋ชจ๋ ์น์
- ISO C++ ํ์ค ๋ฌธ์
- ๊ฐ ์ปดํ์ผ๋ฌ ๊ณต์ ๋ฌธ์ (MSVC, Clang, GCC)
์จ๋ผ์ธ ๊ฐ์:
- CppCon ๋ฐํ ์์๋ค (YouTube)
- C++ Weekly by Jason Turner
- Back to Basics ์๋ฆฌ์ฆ
์ปค๋ฎค๋ํฐ:
- r/cpp (Reddit)
- C++ Slack ์ฑ๋
- Stack Overflow C++ ํ๊ทธ
- ๊ตญ๋ด C++ ์ฌ์ฉ์ ๊ทธ๋ฃน
ํนํ CppCon ์์๋ค์ ์ง์ง ๊ฟํ ๋ง์!
๋ชจ๋ ์ค๊ณํ ๊ฐ๋ฐ์๋ค์ด ์ง์ ์ค๋ช
ํด์ฃผ๊ฑฐ๋ ใ
ใ
์ค๋ฌด ์ ์ฉ ์ฌ๋ก ๐ผ
์ด๋ฏธ ์ฌ๋ฌ ๋ํ ํ๋ก์ ํธ์์ ๋ชจ๋์ ๋์
ํ๊ณ ์์ด!
๋ช ๊ฐ์ง ์ฌ๋ก๋ฅผ ์๊ฐํ ๊ฒ.
Microsoft์ ๊ฒฝ์ฐ:
Windows ๋ด๋ถ ์ปดํฌ๋ํธ ์ผ๋ถ๋ฅผ ๋ชจ๋๋ก ์ ํ ์ค์ด์ผ.
๋น๋ ์๊ฐ์ด 40% ์ด์ ๋จ์ถ๋๋ค๊ณ ํ๋๋ผ! ๐ฎ
๊ฒ์ ์์ง๋ค:
Unreal Engine 5๋ ์ ์ง์ ์ผ๋ก ๋ชจ๋ ์์คํ
๋์
์ ๊ฒํ ์ค์ด๊ณ ,
์ผ๋ถ ๋
๋ฆฝ ๊ฒ์ ์์ง๋ค์ ์ด๋ฏธ ์ ๋ฉด ๋์
ํ์ด!
๊ธ์ต ์์คํ
:
๊ณ ๋น๋ ๊ฑฐ๋(HFT) ์์คํ
์์ ์ปดํ์ผ ์๊ฐ ๋จ์ถ์ด ์ค์ํ์์?
๋ชจ๋ ๋์
์ผ๋ก ๊ฐ๋ฐ ์ฌ์ดํด์ด ํฌ๊ฒ ๊ฐ์ ๋๋ค๋ ์ฌ๋ก๊ฐ ๋ง์.
์ฌ๋ฅ๋ท ๊ฐ์ ํ๋ซํผ์์๋ C++ ๋ชจ๋ ๊ด๋ จ ์ฌ๋ฅ์ ๊ณต์ ํ๋ ์ ๋ฌธ๊ฐ๋ค์ด ๋์ด๋๊ณ ์์ด!
์ค๋ฌด ๊ฒฝํ ์๋ ๊ฐ๋ฐ์ํํ
์ง์ ๋ฐฐ์ฐ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด์ง ๐จโ๐ซ
๋ง๋ฌด๋ฆฌํ๋ฉฐ ๐ฌ
์... ์ฌ๊ธฐ๊น์ง ์ฝ์๋ค๋ฉด ์ง์ง ๋๋จํด ใ
ใ
ใ
๋ค์์คํ์ด์ค๋ถํฐ ๋ชจ๋๊น์ง ๊ฝค ๊ธด ์ฌ์ ์ด์์ง?
ํต์ฌ๋ง ๋ค์ ์ ๋ฆฌํ๋ฉด:
โ ๋ ผ๋ฆฌ์ ๊ทธ๋ฃนํ์ ์ด๋ฆ ์ถฉ๋ ๋ฐฉ์ง
โ ๊ณ์ธต์ ๊ตฌ์กฐ๋ก ์ฝ๋ ์กฐ์งํ
โ ๋ ๊ฑฐ์ ํ๋ก์ ํธ์์๋ ๋ฐ๋ก ์ฌ์ฉ ๊ฐ๋ฅ
๋ชจ๋ ์์คํ :
โ ํ๊ธฐ์ ์ธ ์ปดํ์ผ ์๋ ํฅ์
โ ๋ช ํํ ์ธํฐํ์ด์ค ์ ์
โ ๋งคํฌ๋ก ์ค์ผ ๋ฐฉ์ง
โ C++์ ๋ฏธ๋!
์ค์ ์ ์ฉ:
โ ์ ์ง์ ๋์ ์ด ์์
โ ์์กด์ฑ ๊ด๋ฆฌ๊ฐ ํต์ฌ
โ ๋น๋ ์์คํ ์ค์ ์ค์
โ ํ ์ ์ฒด์ ์ดํด์ ํ๋ ฅ ํ์
๋๊ท๋ชจ ํ๋ก์ ํธ ๊ตฌ์กฐํ๋ ๋จ์ํ ๊ธฐ์ ์ ์ธ ๋ฌธ์ ๊ฐ ์๋์ผ.
ํ์ํฌ, ์ค๊ณ ์ฒ ํ, ์ฅ๊ธฐ์ ๋น์ ์ด ๋ชจ๋ ์ค์ํ์ง!
์ฒ์์๋ ์ด๋ ต๊ฒ ๋๊ปด์ง ์ ์์ด.
ํ์ง๋ง ํ ๋ฒ ์ ๋๋ก ๊ตฌ์กฐํํด๋๋ฉด ๋์ค์ ์์ฒญ๋ ์์ฐ์ฑ ํฅ์์ ๊ฒฝํํ๊ฒ ๋ ๊ฑฐ์ผ! ๐
๋ชจ๋์ ์์ง ๋ฐ์ ์ค์ธ ๊ธฐ์ ์ด๋๊น,
๊ณ์ ์๋ก์ด ์ ๋ณด๋ฅผ ์ฐพ์๋ณด๊ณ ์ปค๋ฎค๋ํฐ์ ์ํตํ๋ ๊ฒ ์ค์ํด.
์ฌ๋ฅ๋ท ๊ฐ์ ํ๋ซํผ์์ ๋ค๋ฅธ ๊ฐ๋ฐ์๋ค๊ณผ ๊ฒฝํ์ ๋๋๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด๊ณ !
์, ์ด์ ์ฌ๋ฌ๋ถ์ ํ๋ก์ ํธ์ ์ ์ฉํด๋ณผ ์ฐจ๋ก์ผ!
์์ ๋ชจ๋ ํ๋๋ถํฐ ์์ํด๋ณด๋ ๊ฑด ์ด๋? ๐
ํ์ดํ ! ์ฐ๋ฆฌ ๋ชจ๋ ๋ ๋์ C++ ๊ฐ๋ฐ์๊ฐ ๋์๊ตฌ! ๐ชโจ
๐ Happy Coding with C++ Modules! ๐
๋๊ท๋ชจ ํ๋ก์ ํธ๋ ์ด์ ๋๋ ต์ง ์์!
๊ด๋ จ ํค์๋
๋๊ธ ์์ฑ
์ด ๊ธ์ ๋ํ ์ฌ๋ฌ๋ถ์ ์๊ฐ์ ๋ค๋ ค์ฃผ์ธ์
๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค
๋๊ธ์ ์์ฑํ๋ ค๋ฉด ๋จผ์ ๋ก๊ทธ์ธํด์ฃผ์ธ์.
๋๊ธ 0
์ง์์ธ์ ์ฒ - ์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
- ์ ์๊ถ ๋ฐ ์์ ๊ถ: ๋ณธ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ๋ ์ AI ๊ธฐ์ ๋ก ์์ฑ๋์์ผ๋ฉฐ, ๋ํ๋ฏผ๊ตญ ์ ์๊ถ๋ฒ ๋ฐ ๊ตญ์ ์ ์๊ถ ํ์ฝ์ ์ํด ๋ณดํธ๋ฉ๋๋ค.
- AI ์์ฑ ์ปจํ ์ธ ์ ๋ฒ์ ์ง์: ๋ณธ AI ์์ฑ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ์ง์ ์ฐฝ์๋ฌผ๋ก ์ธ์ ๋๋ฉฐ, ๊ด๋ จ ๋ฒ๊ท์ ๋ฐ๋ผ ์ ์๊ถ ๋ณดํธ๋ฅผ ๋ฐ์ต๋๋ค.
- ์ฌ์ฉ ์ ํ: ์ฌ๋ฅ๋ท์ ๋ช ์์ ์๋ฉด ๋์ ์์ด ๋ณธ ์ปจํ ์ธ ๋ฅผ ๋ณต์ , ์์ , ๋ฐฐํฌ, ๋๋ ์์ ์ ์ผ๋ก ํ์ฉํ๋ ํ์๋ ์๊ฒฉํ ๊ธ์ง๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์์ง ๊ธ์ง: ๋ณธ ์ปจํ ์ธ ์ ๋ํ ๋ฌด๋จ ์คํฌ๋ํ, ํฌ๋กค๋ง, ๋ฐ ์๋ํ๋ ๋ฐ์ดํฐ ์์ง์ ๋ฒ์ ์ ์ฌ์ ๋์์ด ๋ฉ๋๋ค.
- AI ํ์ต ์ ํ: ์ฌ๋ฅ๋ท์ AI ์์ฑ ์ปจํ ์ธ ๋ฅผ ํ AI ๋ชจ๋ธ ํ์ต์ ๋ฌด๋จ ์ฌ์ฉํ๋ ํ์๋ ๊ธ์ง๋๋ฉฐ, ์ด๋ ์ง์ ์ฌ์ฐ๊ถ ์นจํด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์ง ๋๊ธ์ด ์์ต๋๋ค.