Skip to content

Commit 882e49c

Browse files
committed
Allow to print any free or member class pointer
#include<iostream> #include "tinyformat.h" struct test_debugger { void var() {} }; void fun_void_void(){}; void fun_void_double(double d){}; double fun_double_double(double d){return d;} int main(void) { int* var; std::cout << std::boolalpha; std::cout << tfm::format( "0. %s", &var ) << std::endl; std::cout << tfm::format( "1. %s", &fun_void_void ) << std::endl; std::cout << tfm::format( "2. %s", &fun_void_double ) << std::endl; std::cout << tfm::format( "3. %s", &fun_double_double ) << std::endl; std::cout << tfm::format( "4. %s", &test_debugger::var ) << std::endl; return 0; }
1 parent 4503a27 commit 882e49c

File tree

5 files changed

+327
-125
lines changed

5 files changed

+327
-125
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,5 @@ script:
192192
- mkdir build
193193
- cd build
194194
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCXX_STD=$CXX_STD ..
195-
- make testall
195+
- make testall VERBOSE=1
196196

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING
99
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
1010
)
1111

12+
set(CMAKE_VERBOSE_MAKEFILE ON)
1213
set(CXX_STD "c++11" CACHE STRING "Version of C++ standard in use")
1314

1415
# This project is infrastructure. Warnings from common warning levels should
1516
# be errors on all compilers, unless explicitly silenced.
1617
if(NOT WIN32)
17-
set(CMAKE_CXX_FLAGS "-Wall -Werror -std=${CXX_STD}" CACHE STRING "Flags used by the compiler during all build types.")
18+
set(CMAKE_CXX_FLAGS "-Wall -Werror -g -ggdb -std=${CXX_STD}" CACHE STRING "Flags used by the compiler during all build types.")
1819
endif()
1920

2021
project(tinyformat)
@@ -24,7 +25,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
2425
if(WIN32)
2526
# Treat warnings as errors. Would set this above, but need the default
2627
# flags too, and `project()` behaves is differently on different systems.
27-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX")
28+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX /Z7 /Od")
2829
endif()
2930

3031
add_executable(tinyformat_test tinyformat_test.cpp)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Should work with recent versions of both gcc and clang. (To compile with
44
# clang use "make CXX=clang++".)
55

6-
CXXFLAGS?=-Wall -Werror
6+
CXXFLAGS?=-Wall -Werror -g -ggdb
77
CXX11FLAGS?=-std=c++11
88

99
test: tinyformat_test_cxx98 tinyformat_test_cxx11

0 commit comments

Comments
 (0)