The name of the first Macro Virus, Cira 1996, IIRC. It was given the name 'Concept', because that's what is was, a test to see how much Word's scripting engine could do.

Concept was benign, it's only goal in life being to infect other Word(TM) documents with itself.

In C++, Concepts were first (?) introduced by STL. Unlike most of C++, they are not compiler enforced. Rather, they are documents that specify the structure needed by objects to work with templated algorithms/frameworks. Concepts may be fulfilled by Models, which are just types (including builtin types such as int). For example, the STL specifies the Concept of Sequence, which is a refinement (think subclass) of Container. Sequence may be modelled by vector, list, tree, etc. As long as a type fulfills certain requirements, such as having begin and end methods that behave in a certain way, it may be considered to Model a Concept. There is no explicit statement of relationship. Concepts are usually used within template frameworks, as a way of restricting what may be put as template parameters.

The crucial bit is that Concepts are NOT checked by the compiler. Indeed, the compiler has no clue about Concepts. They only exist in your head. There are concept checking frameworks however, which allow forcing the compiler to verify that requirements of Concepts are fulfilled; Boost includes one, which is used by GNU libstdc++.

In a way, Concepts are similar to interfaces in Java and C#, and indeed in certain cases the two can be used for the same effect (up to the difference of compile-time versus run-time binding and enforcement). Concepts are actually much closer to type classes in Haskell1, but whereas the Haskell compiler enforces type class restrictions, C++ relies on structural isomorphism. C# generics (in .NET 2.0) take after Haskell in this respect.


1 I didn't use this as the primary example because not as many programmers are versed in Haskell as Java and C#.

Con"cept (?), n. [L. conceptus (cf. neut. conceptum fetus), p. p. of concipere to conceive: cf. F. concept. See Conceit.]

An abstract general conception; a notion; a universal.

The words conception, concept, notion, should be limited to the thought of what can not be represented in the imagination; as, the thought suggested by a general term. Sir W. Hamilton.

 

© Webster 1913.

Log in or registerto write something here or to contact authors.