lis05's blog

By lis05, history, 19 months ago, translation, In English

This project has been developed for more than a year. It's a third version (but the name historically was left as CPv2) and I think it's finally ready to be presented to you.

CPv2 — Meet a new and great Competitive programming environment for C++ to make life easier!

Main features are:

  • fast compilation (with precompiled headers)
  • time and memory measurements
  • variety of run modes
  • built in snippets support
  • built in templates support
  • file io
  • ships with premade code template ( REPLACED CIN/COUT WITH MUCH BETTER THINGS! )
  • console interface with formatted output

Link to github: https://github.com/lis05/CPv2

You absolutely MUST take a look at the replacements for cin/cout. They are the best thing I've ever seen in my life.

  • Vote: I like it
  • +58
  • Vote: I do not like it

»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it

is it available for windows?

»
19 months ago, # |
  Vote: I like it +28 Vote: I do not like it

Unfortunately, the pragmas don't do anything in the template, and the typedefs break on different architectures (that's why the STL has things like uint32_t). For the multiple definitions of the same macro, you might want to look into variadic arguments. Also, using the name __print is undefined behaviour and is reserved for the implementation, so you might want to use something different.

  • »
    »
    19 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hi! Thank you for your comment.

    I removed typedefs and replaced everything with STL types. Also replaced __print with __print_data. However, regarding pragmas, I've been using them for quite some time, and I'm sure they must work. Can you elaborate a little bit please?

    • »
      »
      »
      19 months ago, # ^ |
      Rev. 2   Vote: I like it +8 Vote: I do not like it

      My bad, I meant variables starting with a double underscore are reserved for the implementation. Variables should not start with a single underscore either — things like _start and _main are also reserved (so just avoid this kind of naming, and instead use a namespace to define such functions if you really want to separate the naming).

      For fixing the pragma issue, note that the pragmas go before anything else in the file (even before the includes, so that they can optimize what is in the headers as well).

      • »
        »
        »
        »
        19 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I see. I originally placed pragmas after the include file because otherwise fast compilation wouldn't work (precompiled header wouldn't get used by the compiler). I will add a workaround to this. Thanks!

»
15 months ago, # |
Rev. 2   Vote: I like it -21 Vote: I do not like it

-