xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.

◆ line_info_

#define line_info_   xtd::tunit::line_info {__func__, __FILE__, __LINE__}

Get xtd::tunit::line_info informations.

Returns
xtd::tunit::line_info line informations.
Examples
The following example shows how to use the line_info_.
#include <xtd/xtd.tunit>
#include <iostream>
using namespace std;
using namespace xtd::tunit;
void trace_message(const string& message, const line_info& info) {
cout << "message: " << message << endl;
cout << "member name: " << info.member_name() << endl;
cout << "source file path: " << info.file_path() << endl;
cout << "source line number: " << info.line_number() << endl;
}
int main() {
trace_message("Something happened.", line_info_);
}
// This code can produce the following output:
//
// message: Something happened.
// member name: main
// source file path: /Users/UserName/Projects/xtd/xtd.tunit/examples/line_info/src/line_info.cpp
// source line number: 16