[C++] Detect CodeLite parser in code?
Posted: Sat Mar 25, 2017 6:14 am
I've got a template struct with the following declaration:
I'm using CodeLite 10.0.0, with clang code completion not enabled, so basically using CodeLite's own parser. If I try to use aforementioned template, e.g.:
Depending on some circumstances and that template location, I either get a list of few members from a completely different class, or a list of members that were declared before that "using U" statement. Basically, that definition completely confuses CodeLite.
Likely CodeLite doesn't understand that construct and perhaps there would be other constructs that would throw havoc to CodeLite's parser. So my question is, would be there a way to detect CodeLite in code, for instance, by using something like #ifdef codelite, so that I can replace that tricky definition with something simpler that CodeLite could understand and parse the rest of template reasonably well?
Code: Select all
template <typename T>
struct Test
{
T member;
using U = typename std::conditional<std::is_floating_point<T>::value, T, typename std::conditional<sizeof(T) <= 4, float, double>::type>::type;
T getMember() const { return member; }
U getMember2() const { return static_cast<U>(member); }
};
Code: Select all
Test<int> abc;
abc. // this triggers code completion dialog
Likely CodeLite doesn't understand that construct and perhaps there would be other constructs that would throw havoc to CodeLite's parser. So my question is, would be there a way to detect CodeLite in code, for instance, by using something like #ifdef codelite, so that I can replace that tricky definition with something simpler that CodeLite could understand and parse the rest of template reasonably well?