WND-SX is a super-minimal C++ syntax utility that adds a simple, JavaScript/TypeScript-inspired way to handle basic input, output, and variable declaration.
#ifndef WND_SX_HPP
#define WND_SX_HPP
#include<iostream>
#include<typeinfo>
namespace w{
struct C{
void operator()(const std::type_info&x)const{std::cout<<x.name()<<'\n';}
template<class...T>void operator()(T&&...x)const{((std::cout<<x),...);std::cout<<'\n';}
};
struct I{
template<class...T>void operator()(T&...x)const{(std::cin>>...>>x);}
};
}
inline constexpr w::C cout{};
inline constexpr w::I cin{};
#define var auto
#endifcout()— simple console output without<<cin()— simple input without>>var— automatic type deduction using C++auto- Keeps the original C++ syntax completely intact
- Lightweight single-header library
- No external dependencies
#include "WND_SX.hpp"
int main() {
var name = "Jigu";
var age = 19;
cout("Name:", name);
cout("Age:", age);
cin(age);
}WND-SX doesn't replace C++; it simply provides a cleaner syntax layer on top of standard C++.