A
A
asurkis2016-06-27 12:05:17
IDE
asurkis, 2016-06-27 12:05:17

Are auto hints possible for this code?

Just out of curiosity, are there any IDEs that can provide hints for such code?
Of course, you should not write code like this, but I want to know

#define DECLARE_INT_NODE(current, next) \
    template<> struct int_node<current> \
    { \
        typedef current current_type; \
        typedef next next_type; \
    };
#define DECLARE_MULTIPLE_NODES(prefix) \
    DECLARE_INT_NODE(prefix char, prefix short) \
    DECLARE_INT_NODE(prefix short, prefix int) \
    DECLARE_INT_NODE(prefix int, prefix long) \
    DECLARE_INT_NODE(prefix long, prefix long long) \
    template<> struct int_node<prefix long long> \
    { \
        typedef prefix long long current_type; \
    };
template<class> struct int_node;
DECLARE_MULTIPLE_NODES(signed)
DECLARE_MULTIPLE_NODES(unsigned)
#undef DECLARE_MULTIPLE_NODES
#undef DECLARE_INT_NODE

Qt Creator gives a hint that exists int_node, but parses only int_node<unsigned long long>, and accordingly always shows only the current_type = unsigned long long
CodeLite member + clang does not give a hint that exists int_node, although if you write, for example, int_node<unsigned short>::it shows that this type has members current_type = unsigned shortand next_type = unsigned int
CodeLite + ctags with does not cope with the task at all, that is, it does not see either itself int_nodeor its members
I would like to know if there is any program other than the compiler that can parse this terrible code, that is, give a hint about what exists int_node<class>and about the members of each specific type (like int_node<unsigned short>)
From examples that are closer to reality, although no longer terrible, but seem to have the right to exist examples:
Qt Creator cannot give hints on such code:
std::string()., that is, after pressing the dot, it is "silent"
CodeLite + ctags and CodeLite + clang cope with such code without problems.
Moreover, if you write in the same Qt Creator
std::string s;
s.
then it gives hints after pressing the dot
The answer to this question does not affect the choice of IDE, but this question is asked purely for the sake of interest
PS Due to traffic restrictions, I can not try the suggested options, so please attach a screenshot to the answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maaGames, 2016-06-27
@asurkis

MSVC + Whole Tomato. Handles almost anything. The newer MSVC is, the better auto-suggestion and other useful things can handle a large number of situations.
16b0fa185f36409fa0ad69bbfe5d3db3.pngb781dc3bbe504c51a6ef6c10a316b554.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question