Skip to content

A small header only library to suppress unused variable and parameter warnings in a cross-platform manner without the use of macros.

License

Notifications You must be signed in to change notification settings

kernhanda/unused_args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

unused_args

A small header only library to suppress unused variable and parameter warnings in a cross-platform manner without the use of macros.

Sample

#include <iostream>
#include <unused_args/unused_args.hpp>

constexpr int add(int a, int b) {
    unsigned i{};
    unused_args(i);

    return a + b;
}

void func(unsigned number, const int version) {
    unsigned tmp1{};
    unsigned tmp2{};
    unused_args(tmp1, tmp2);

    std::cout << number << std::endl;
}

int main(int a, char**) {
    func(add(10, 100), 1);

    return 0;
}

About

A small header only library to suppress unused variable and parameter warnings in a cross-platform manner without the use of macros.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages