CMakePP / CMakePPLang

Object-oriented extension to the CMake language.
http://cmakepp.github.io/CMakePPLang/
Apache License 2.0
11 stars 4 forks source link

Support for pure virtual member functions #5

Closed ryanmrichard closed 4 years ago

ryanmrichard commented 4 years ago

If we define a macro like:

macro(pure_virtual_function fxn_name)
    function("${${fxn_name}}")
        message(
            FATAL_ERROR 
            "${fxn_name} is pure virtual and must be overriden by derived class"
        )
    endfunction()
endmacro()

then we can implement pure virtual member functions like:

cpp_class(MyClass)
    cpp_member(a_pure_virtual_fxn MyClass)
    pure_virtual_function(a_pure_virtual_fxn)
cpp_end_class()
ryanmrichard commented 4 years ago

closed with #21