1

There is code in dmlc as below:

#define DMLC_REGISTRY_REGISTER(EntryType, EntryTypeName, Name)          \
  static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ =      \
      ::dmlc::Registry<EntryType>::Get()->__REGISTER__(#Name)           \

What is meaning of __make_ in here? Contact with EntryTypeName and Name? Any link will explain it?

What is the output about static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ =?

melpomene
  • 84,125
  • 8
  • 85
  • 148
刘米兰
  • 183
  • 2
  • 11
  • 2
    Do you know what `##` does in the C preprocessor? See http://stackoverflow.com/questions/216875/what-are-the-applications-of-the-preprocessor-operator-and-gotchas-to-conside – Barmar Jul 01 '16 at 04:08
  • 3
    `__make_` is just a prefix being put onto all the names that get defined using the macro. – Barmar Jul 01 '16 at 04:09
  • 2
    I don't think it particularly makes a difference to the question, but isn't this C++ rather than C? – Paul Hankin Jul 01 '16 at 04:30
  • 1
    Gah. Please don't write code like this outside your garage. – Lundin Jul 01 '16 at 11:32

0 Answers0