Documentation Status

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

Documented

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

Documented

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

Released Continuous integration Documented

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

Released Continuous integration Documented

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

Released Continuous integration Documented

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

Released Continuous integration Documented

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

Released Continuous integration Documented

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

Cannot load information on name: ecl_concepts, distro: lunar, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.
Cannot load information on name: ecl_concepts, distro: melodic, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.

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

  • BluePrints - checks for blueprint functionality as defined in ecl_utilities.

  • Containers - also bytecontainer, simple checks for basic prerequisite container methods.

  • NullaryFunctions - function objects which require no arguments in execution.

  • Streams - any class with basic char streaming capabilities.

  • Devices - device functionalities compatible to those in ecl_devices.

Wiki: ecl_concepts (last edited 2012-01-17 23:35:45 by DanielStonier)