Skip to content

debug.h ~ debug ~ level

Baptiste Thémine edited this page Jul 5, 2020 · 5 revisions
template <short flag> std::ios& level(std::ios &ios) noexcept;

Description

Sets debug flag to the specified level in iostream. Calls the function debug::flag.

Parameters

  • flag --> integer between 0 and 3 corresponding to the level of debug (0 = debug::off, N = debug::levelN).
  • ios --> reference to an iostream object.

Return value

Returns a reference to ios passed in argument.

Exceptions

Never throws exception. If call to debug::flag fails, the debug flag is unchanged and the iostream state is set to std::badbit.

Examples

#include <iostream>
#include <JLC/debug.h>

int main(){
    std::cout << debug::level<0>;
    std::cin >> debug::level<3>;
}

See also

Clone this wiki locally