https://github.com/jaytwolab/cpp.define_member_and_setter
Define Member and Setter Macro for C++ :kr: C++용 멤버 변수 및 Setter 매크로 정의
https://github.com/jaytwolab/cpp.define_member_and_setter
Last synced: 5 months ago
JSON representation
Define Member and Setter Macro for C++ :kr: C++용 멤버 변수 및 Setter 매크로 정의
- Host: GitHub
- URL: https://github.com/jaytwolab/cpp.define_member_and_setter
- Owner: JayTwoLab
- License: mit
- Created: 2025-07-22T12:41:28.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-23T12:43:22.000Z (6 months ago)
- Last Synced: 2025-07-28T22:00:48.836Z (6 months ago)
- Language: C++
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ko.md
- License: LICENSE
Awesome Lists containing this project
README
# C++용 멤버 변수 및 Setter 매크로 정의
이 프로젝트는 C++17 이상에서 멤버 변수와 체이닝 가능한 setter 함수를 동시에 정의할 수 있는 간단한 매크로를 제공합니다.
## 주요 기능
- 매크로 한 줄로 멤버 변수와 setter를 정의
- 코드 가독성과 유지보수성 향상
- C++17 이상에서 동작
## 사용 예시
```cpp
#include "DefineMemeberAndSetter.hpp"
struct Config {
DEFINE_MEMBER_AND_SETTER(std::string, name)
DEFINE_MEMBER_AND_SETTER(int, width)
DEFINE_MEMBER_AND_SETTER(int, height)
};
```
사용법:
```cpp
Config cfg;
// Setter
cfg.name("Main Window")
.width(1280)
.height(720);
// Getter
std::cout << "Name: " << cfg.name() << "\n";
std::cout << "Width: " << cfg.width() << "\n";
std::cout << "Fullscreen: " << std::boolalpha << cfg.fullscreen() << "\n";
```
## 빌드 방법
```bash
mkdir build && cd build
cmake ..
make
```
## 라이선스
- MIT License
- https://github.com/JayTwoLab/cpp.define_member_and_setter