Comments (9)
When using a compiler that doesn't support variadic templates, the number of arguments to the formatting functions is currently limited to 10. Which compiler do you use?
from fmt.
I am using VS2010, How to expand the support?
from fmt.
This code compiler is no problem.
printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,",1,1,1,1,1,1,1,1,1,1,1,1,1);
from fmt.
only VS2013 support Variadic templates
for your compiler it is some Macros magic to emulate such functional
from fmt.
Say so, compiler < vs2013 is only limited in the 10 parameter?
from fmt.
Right, VS2010 doesn't support variadic templates, so variadic functions are emulated using macros there. I can increase the limit if you like if you are sure that you want to pass more parameters to the formatting functions. Do you have a practical example or you just exploring the limitations?
from fmt.
Hope to be able to increase the limit, it can meet various requirements.
I asked our team to recommend the use of cppformat, and hopes to be able to eliminate the boost.format, will eventually be used in our products, our products have more than 15 parameters of the demand.
Thank you, sir.
The great works.
from fmt.
igmss.cpp: In function 'int main(int, char*)':
igmss.cpp:9: error: no matching function for call to 'format(const char [21], int, int, int, int, int, int, int, int, int, int, int, int)'
format.h:1743: note: candidates are: std::string fmt::format(fmt::StringRef, const fmt::ArgList&)
format.h:1749: note: std::wstring fmt::format(fmt::WStringRef, const fmt::ArgList&)
format.h:2039: note: std::string fmt::format(fmt::StringRef)
format.h:2040: note: std::wstring fmt::format(fmt::WStringRef)
make: ** [main.o] Error 1
[ivm1001@localhost ~]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
[ivm1001@localhost ~]$ cat /etc/redhat-release
CentOS release 6.5 (Final)
The use of cppformat in the old compiler, the performance will be reduced?
from fmt.
Thanks for the additional information. I've increased the formatting argument limit on compilers without variadic template support to 15 in d59fbdc . Feel free to reopen this issue if you need more, it's pretty easy to increase further if necessary.
The performance shouldn't depend much on whether variadic templates are supported or not, because the code is virtually identical, in both cases an array of arguments is constructed and passed to the main formatting function which is the same for C++11 & older compilers.
from fmt.
Related Issues (20)
- Feature Request: Convert Format String to RegEx HOT 1
- fmt/std.h happy with c++20, unhappy with c++23 HOT 2
- feature request: support for emphasis and coloring in print and println HOT 1
- support C++23 character range formatting HOT 1
- chrono locale format code has some bug when using RHEL gcc on CentOS 7.6 to compile
- Dynamic precision for `nested_formatter` does not work
- Error: expected unqualified-id before numeric constant
- Is C++ 20 a minimum requirement to build the lib? HOT 10
- Proposal to add syntax for removing leading zeros in time formatting HOT 1
- `[email protected]` has CMake package version 10.1.0 HOT 1
- Proposal: return formatted arguments along with the formatted string HOT 1
- Build fails on non Desktop App Windows API family HOT 2
- [feature-request] make `fmt::detail::file_print_buffer` public HOT 3
- [feature-request] Built-in formatter for exception classes derived from std::exception HOT 2
- Where is the implementation for FMT_API auto vformat(string_view fmt, format_args args) -> std::string;? HOT 1
- Exception with fmt::arg as floating-point precision, FMT version 100202 HOT 1
- formatting double with fixed format, but no trailing zeros HOT 9
- [qtest-parallel testing] C++ exception with description "cannot open file test-file: No such file or directory" thrown in the test body. HOT 2
- 10.1.1 version number mistake HOT 1
- Does not build on OpenBSD HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmt.