While reading the new PR that adds NULLS FIRST/NULLS LAST, I came across a couple of places in the code that looked a slightly suspicious, so I decided to open a new issue about them:
- Comments about CRTP. There are several structures that have comments in them that they should be used in CRTP:
|
// To be used as CRTP base for aggregate expressions that should offer the |
|
// To be used as CRTP base for expressions that should offer the comparison |
|
// To be used as CRTP base for expressions that should offer the as() member |
All these comments about CRTP seem to be obsolete and probably should be updated. None of these structures are actually used with the CRTP pattern. I guess CRTP has been replaced by deducing this?
- There are a multiple places where various structures inherit from
enable_comparison which means that they all get the asc() and desc() methods. E.g. type cast expressions, case expressions and string concat expressions inherit from enable_comparison. I haven't actually tried with an actual test program, but given that they all inherit from enable_comparison, it seems to me that they all get the asc() and desc() methods. Aren't there too many expressions that get these methods? E.g. all of the ones that I listed above shouldn't get asc() and desc().
While reading the new PR that adds NULLS FIRST/NULLS LAST, I came across a couple of places in the code that looked a slightly suspicious, so I decided to open a new issue about them:
sqlpp23/include/sqlpp23/core/aggregate_function/enable_over.h
Line 33 in f3f344d
sqlpp23/include/sqlpp23/core/operator/enable_comparison.h
Line 33 in f3f344d
sqlpp23/include/sqlpp23/core/operator/enable_as.h
Line 35 in f3f344d
All these comments about CRTP seem to be obsolete and probably should be updated. None of these structures are actually used with the CRTP pattern. I guess CRTP has been replaced by deducing this?
enable_comparisonwhich means that they all get the asc() and desc() methods. E.g. type cast expressions, case expressions and string concat expressions inherit fromenable_comparison. I haven't actually tried with an actual test program, but given that they all inherit fromenable_comparison, it seems to me that they all get theasc()anddesc()methods. Aren't there too many expressions that get these methods? E.g. all of the ones that I listed above shouldn't getasc()anddesc().