Giter Club home page Giter Club logo

Comments (9)

vitaut avatar vitaut commented on May 21, 2024

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.

pkbig avatar pkbig commented on May 21, 2024

I am using VS2010, How to expand the support?

from fmt.

pkbig avatar pkbig commented on May 21, 2024

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.

newnon avatar newnon commented on May 21, 2024

only VS2013 support Variadic templates
for your compiler it is some Macros magic to emulate such functional

from fmt.

pkbig avatar pkbig commented on May 21, 2024

Say so, compiler < vs2013 is only limited in the 10 parameter?

from fmt.

vitaut avatar vitaut commented on May 21, 2024

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.

pkbig avatar pkbig commented on May 21, 2024

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.

pkbig avatar pkbig commented on May 21, 2024

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.

vitaut avatar vitaut commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.