cs_signal icon indicating copy to clipboard operation
cs_signal copied to clipboard

conflict with CsLibGuarded

Open ericLemanissier opened this issue 4 years ago • 0 comments

Both CsSignal and CsLibGuarded provide the class template rcu_guarded in the namespace libguarded: https://github.com/copperspice/cs_signal/blob/master/src/cs_rcu_guarded.h https://github.com/copperspice/cs_libguarded/blob/master/src/cs_rcu_guarded.h This has a very high likelihood of producing ODR violation per https://eel.is/c++draft/basic.def.odr#10.sentence-1 https://eel.is/c++draft/basic.def.odr#13.sentence-1 https://eel.is/c++draft/basic.def.odr#13.8 https://eel.is/c++draft/basic.def.odr#15 because there is no way a user of both these libraries can know if these two definitions consist of the same sequence of tokens, without brute-forcing the comparison of sources.

some possibilities:

  • make CsSignal depend on CsLibGuarded instead of duplicating its sources
  • document that both libraries cannot be used in the same program
  • document which versions of these libraries are compatible (requires fixing https://github.com/copperspice/cs_signal/issues/15 beforehand)
  • put these classes in different namespaces or rename the classes

The same situation happens with https://github.com/copperspice/copperspice which embeds CsSignal, CsLibGuarded and CsString

ericLemanissier avatar Feb 10 '21 07:02 ericLemanissier