fmt/doc
Mike Crowe e6ef927e6b
fmt::ptr: Support function pointers (#2131)
Passing a function pointer to fmt::ptr results in:

 In file included from /home/mac/git/fmt/test/gmock/gmock.h:238,
                  from /home/mac/git/fmt/test/format-test.cc:31:
 .../fmt/test/format-test.cc: In member function ‘virtual void FormatterTest_FormatPointer_Test::TestBody()’:
 .../fmt/test/format-test.cc:1486:56: error: no matching function for call to ‘ptr(void (&)(int, double, std::__cxx11::string))’
              format("{}", fmt::ptr(function_pointer_test)));

with GCC and Clang. Let's add an overload to support that usage.

Unfortunately, MSVC would
consider the overload to be ambiguous for unknown reasons:

 D:\a\fmt\fmt\test\format-test.cc(1485,1): error C2668: 'fmt::v7::ptr': ambiguous call to overloaded function [D:\a\fmt\build\test\format-test.vcxproj]
 D:\a\fmt\fmt\include\fmt/format.h(3742,60): message : could be 'const void *fmt::v7::ptr<void,int,double,std::string>(T (__cdecl *)(int,double,std::string))' [D:\a\fmt\build\test\format-test.vcxproj]
           with
           [
               T=void
           ]
 D:\a\fmt\fmt\include\fmt/format.h(3735,42): message : or       'const void *fmt::v7::ptr<void(int,double,std::string)>(T (__cdecl *))' [D:\a\fmt\build\test\format-test.vcxproj]
           with
           [
               T=void (int,double,std::string)
           ]
 D:\a\fmt\fmt\test\format-test.cc(1486,1): message : while trying to match the argument list '(overloaded-function)' [D:\a\fmt\build\test\format-test.vcxproj]

but luckily this means that the overload is unnecessary in that case
anyway, so we can just make it conditional.
2021-02-09 07:35:16 -08:00
..
_static Customize Sphinx theme 2015-05-19 08:13:13 -07:00
_templates Update analytics 2020-05-18 10:26:22 -07:00
basic-bootstrap add SOURCELINK_SUFFIX for compatibility with Sphinx 1.5 2018-01-28 20:20:39 -08:00
bootstrap .container -> .tb-container (fixes #165) 2015-05-23 12:28:41 -07:00
api.rst fmt::ptr: Support function pointers (#2131) 2021-02-09 07:35:16 -08:00
build.py Document output_file 2021-01-09 07:18:56 -08:00
CMakeLists.txt Partially revert 638db5 because it breaks the doc build 2020-07-26 09:44:37 -07:00
conf.py Update copyright 2018-03-04 10:11:44 -08:00
contents.rst Customize Sphinx theme 2015-05-19 08:13:13 -07:00
fmt.less cppformat -> fmt 2016-04-24 10:39:33 -07:00
index.rst docs: use https for some links (#2051) 2020-12-05 06:41:38 -08:00
python-license.txt Move license to a separate file 2015-05-07 06:43:13 -07:00
syntax.rst Update docs 2021-01-17 09:36:06 -08:00
usage.rst Fix a link to Android.mk (#2057) 2020-12-09 08:04:58 -08:00