CQL constraint of list of classes to find bases with non-virtual destructors?

StackOverflow https://stackoverflow.com/questions/5115228

  •  21-12-2020
  •  | 
  •  

Domanda

Is it possible to use cppdepend (yes C++) to do the equivalent of Make destructors virtual in base classes as Scott Meyers discussed in his very old comparison of C++ analysis tools?

I can list methods with a query

SELECT TOP 100 METHODS WHERE !IsVirtual AND IsDestructor

What I need is like a nested query that allows me to constrain types by methods or vice versa, which is what I think would also answer this question.

Imaginary syntax might be like

SELECT TOP 100 METHODS WHERE !IsVirtual AND IsDestructor AND 
MethodClass IN TYPES WHERE NbChildren > 0

or

SELECT TOP 100 METHODS 
OUT OF TYPES (WHERE NbChildren > 0) 
WHERE !IsVirtual AND IsDestructor
È stato utile?

Soluzione

This is no possible yet with CQL that doesn't support currently nested queries. The next major version of NDepend, (to be release during the first half of 2012), will let you write this kind of query.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top