Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

WND-SX

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

#endif

Features

  • cout() — 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

Example

#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++.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages