Re: [dev] c++-style comments [was fsbm]

From: Louis Santillan <lpsantil_AT_gmail.com>
Date: Thu, 6 Nov 2014 10:00:47 -0800

It's a joke only if you're laughing. Hey, it's no worse than
stringifying/blobbing a C file [0] (which works well in gcc/clang).
All people have done is game cpp and the standard.

  #define STRINGIFY(src) #src

  inline const char* Kernels() {
    static const char* kernels = STRINGIFY(
      #include "kernels/util.cl"
      #include "kernels/basic.cl"
    );
    return kernels;
  }


[0] http://stackoverflow.com/questions/6502173/preprocessor-tomfoolery-stringifying-a-include

On Thu, Nov 6, 2014 at 9:45 AM, FRIGN <dev_AT_frign.de> wrote:
> On Thu, 6 Nov 2014 09:34:17 -0800
> Louis Santillan <lpsantil_AT_gmail.com> wrote:
>
>> There is one case where C++ style comment create a useful feature that I
>> don't believe C style comments are able to replicate. Some might disagree.
>> In a color syntax highlighting editor in a C99 codebase, you can prefix C
>> style comments with C++ style comments and get single character feature
>> enable/disabling.
>>
>> //* Remove first / to disable this block
>> doSomething();
>> //*/
>>
>> In a color syntax highlighting editor, doSomething(); takes on normal
>> highlighting when enabled, and takes on comment colored highlighting when
>> disabled.
>
> Is this a joke?
>
> --
> FRIGN <dev_AT_frign.de>
>
Received on Thu Nov 06 2014 - 19:00:47 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 06 2014 - 19:12:07 CET