terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

C++11 '>>>' closing brackets problem #68

Closed rakhimov closed 9 years ago

rakhimov commented 9 years ago

In function declaration, deeply nested templates may end with multiple closing bracket without spaces in-between (C++11)

 void f(a<b<c<d>>> arg) {}

This is conflicting with '>>>' symbol. Whatever that symbols means, its deletion seems not to cause any test failures.

terryyin commented 9 years ago

Oops! So templated!

rakhimov commented 8 years ago

It turns out Nvidia Cuda C/C++ code uses this <<< along with `>>>`` for kernel launch. It sounds awkward, but probably somethings that makes sense and is a syntactic sugar for GPGPU developers.

From Wikipedia:

kernel <<< gridDim, blockDim, 0 >>> (d_data, height, width);

I am not sure if Lizard should support the code.

Got the following quote from GPGPU language comparison blog

CUDA’s “<<< >>>” breaks all C/C++ compilers, making it very hard to make a frontend of IDE-plugin.

terryyin commented 8 years ago

I guess the cost is it will slow the tokenising a little bit.