test cuda: import fmt in CUDA source code
Current test is only for Windows(cl.exe).
Need to test more with the other host compilers...
* Activate the test when `find_package(CUDA)` worked
* The test runs with C++14
Detailed comments in 'test/cuda-test'
test cuda: add more comment / macro check
* checks both `__NVCC__` and `__CUDACC__`
More comments for CMake and CUDA source file.
test cuda: <fmt/core.h> checks NVCC and CUDA
The header file checks 2 things.
* __NVCC__: if the compiler is from NVIDIA
* __CUDACC__: if the source code is CUDA(.cu) file
Since we can't sure all users prefer latest, Version for
`find_pacakge(CUDA)` is downgraded to 9.0.
This is the minimum version for C++14 in CUDA
QtCreator (4.9) Clang Code Model (Clang 7) gives the
warning:core.h:404:11: error: an attribute list cannot appear here
core.h:116:24: note: expanded from macro 'FMT_NORETURN'
* Update format.cc
As the explicit instantiation *declaration* of `internal::basic_data<void>` in format.h, this explicit instantiation *definition* should mirror FMT_API also.
* Mirror visibility of explicit instantiation declaration
explicit instantiation declaration of internal::basic_data<void> should mirror visibility of FMT_API
* Eliminate `__declspec(dllexport)` designation on extern template internal::basic_data<> when `extern` affected during exporting phase.
* Add `FMT_EXTERN_TEMPLATE_API` for designate DLL export `extern template`
When exporting DLL, do not designate `__declspec(dllexport)` any template that has any explicit class template declaration a.k.a. `extern template`. Instead, designate `__declspec(dllexport)` at single point where we have explicit class template definition a.k.a. normal instantiation without `extern`
Note: this is a c++11 feature.
* Delete whole `FMT_USE_EXTERN_TEMPLATES` block and its condition
1. Remove whole `FMT_USE_EXTERN_TEMPLATES` block
(trailing `FMT_UDL_TEMPLATE` block)
````
#ifndef FMT_USE_EXTERN_TEMPLATES
# ifndef FMT_HEADER_ONLY
# define FMT_USE_EXTERN_TEMPLATES \
((FMT_CLANG_VERSION >= 209 && __cplusplus >= 201103L) || \
(FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11))
# else
# define FMT_USE_EXTERN_TEMPLATES 0
# endif
#endif
````
2. Delete `FMT_USE_EXTERN_TEMPLATES` condition, only condition, that trailing basic_data class template definition.
````
#if FMT_USE_EXTERN_TEMPLATES
extern template struct basic_data<void>;
#endif
````
3. Replace `FMT_API` with new `FMT_EXTERN_TEMPLATE_API` added in `core.h` for sake of extern template of `basic_data<void>`
* Add `#define FMT_EXTERN extern` only when not `FMT_HEADER_ONLY`
* Replace `extern` on basic_data<void> with the `FMT_EXTERN` condition in core.h
* replace misspelled if !define() with ifndef
* Clarify usage of fmt::arg
Document that fmt::arg takes a non-owning
reference, even if that reference is to
a temporary. As such, users should make sure
the lifetime of the reference lasts as long
as the named argument.
* Clean up language
Remove mentions of `std::reference_wrapper` and rvalues
in favor of more common terminology like dangling references.
C++17 deprecated 'std::result_of' in favour of 'std::invoke_result' and will ban it outright in C++20. Therefore
- implement 'internal::result_of' in terms of 'std::invoke_result' when compiling C++17 mode.
- implement 'internal::result_of' in terms of 'std::result_of' when compiling in modes C++11 or C++14.
Signed-off-by: Daniela Engert <dani@ngrt.de>