Added cmake sandbox for templates and examples

Included test to confirm when NDEBUG is defined