[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Introduces a compile time concept checking mechanism that can be used most commonly to check for required functionality when passing template arguments.

Overview

For templatised functions and classes, the input template arguments usually have little or no restriction on the class that can be used, e.g.

   1 template <typename T>
   2 void f(T input) {
   3     // use some aspect of T's interface
   4 }

Of course the compile will fail if you try to use an input type, T, that doesn't have the specialised interface you want, but the compile time error message is often very verbose and its difficult to find the error. An idea which is merging into the c++ mainstream as well as that used by the boost concept checking library is to characterise common behaviours into _Concepts_. A simplified version of this is utilised here.

Compiling & Linking

Include the following at the top of any translation unit:

   1 #include <ecl/concepts.hpp>
   2 
   3 // The concept definition/validation classes.
   4 using ecl::BluePrintConcept;
   5 using ecl::ContainerConcept;
   6 using ecl::SignedByteContainerConcept;
   7 using ecl::UnsignedByteContainerConcept;
   8 using ecl::NullaryFunctionConcept;
   9 using ecl::StreamConcept;
  10 using ecl::InputCharDeviceConcept;
  11 using ecl::OutputCharDeviceConcept;
  12 using ecl::InputOutputCharDeviceConcept;
  13 using ecl::InputByteDeviceConcept;
  14 using ecl::OutputByteDeviceConcept;
  15 using ecl::InputOutputByteDeviceConcept;

Usage

Concepts

Existing concepts in the ecl include:

@section conceptsList Existing Concepts


2024-11-02 14:23