€cdocutils.nodes document q)q}q(U nametypesq}q(X!generic programming in conceptc++qˆX[n2081] conceptsqˆXconceptc++ concept webqˆXconceptsq NuUsubstitution_defsq }q Uparse_messagesq ]q Ucurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUgeneric-programming-in-conceptcqhUn2081-conceptsqhUconceptc-concept-webqh UconceptsquUchildrenq]qcdocutils.nodes section q)q}q(U rawsourceqUUparentqhUsourceqX./root/project/libs/gil/doc/design/concepts.rstqUtagnameq Usectionq!U attributesq"}q#(Udupnamesq$]Uclassesq%]Ubackrefsq&]Uidsq']q(haUnamesq)]q*h auUlineq+KUdocumentq,hh]q-(cdocutils.nodes title q.)q/}q0(hXConceptsq1hhhhh Utitleq2h"}q3(h$]h%]h&]h']h)]uh+Kh,hh]q4cdocutils.nodes Text q5XConceptsq6…q7}q8(hh1hh/ubaubcdocutils.nodes paragraph q9)q:}q;(hXªAll constructs in GIL are models of GIL concepts. A *concept* is a set of requirements that a type (or a set of related types) must fulfill to be used correctly in generic algorithms. The requirements include syntactic and algorithmic guarantees. For example, GIL class ``pixel`` is a model of GIL ``PixelConcept``. The user may substitute the pixel class with one of their own, and, as long as it satisfies the requirements of ``PixelConcept``, all other GIL classes and algorithms can be used with it. See more about concepts is avaialble at `Generic Programming in ConceptC++ `_hhhhh U paragraphq(h5X4All constructs in GIL are models of GIL concepts. A q?…q@}qA(hX4All constructs in GIL are models of GIL concepts. A hh:ubcdocutils.nodes emphasis qB)qC}qD(hX *concept*h"}qE(h$]h%]h&]h']h)]uhh:h]qFh5XconceptqG…qH}qI(hUhhCubah UemphasisqJubh5XÑ is a set of requirements that a type (or a set of related types) must fulfill to be used correctly in generic algorithms. The requirements include syntactic and algorithmic guarantees. For example, GIL class qK…qL}qM(hXÑ is a set of requirements that a type (or a set of related types) must fulfill to be used correctly in generic algorithms. The requirements include syntactic and algorithmic guarantees. For example, GIL class hh:ubcdocutils.nodes literal qN)qO}qP(hX ``pixel``h"}qQ(h$]h%]h&]h']h)]uhh:h]qRh5XpixelqS…qT}qU(hUhhOubah UliteralqVubh5X is a model of GIL qW…qX}qY(hX is a model of GIL hh:ubhN)qZ}q[(hX``PixelConcept``h"}q\(h$]h%]h&]h']h)]uhh:h]q]h5X PixelConceptq^…q_}q`(hUhhZubah hVubh5Xr. The user may substitute the pixel class with one of their own, and, as long as it satisfies the requirements of qa…qb}qc(hXr. The user may substitute the pixel class with one of their own, and, as long as it satisfies the requirements of hh:ubhN)qd}qe(hX``PixelConcept``h"}qf(h$]h%]h&]h']h)]uhh:h]qgh5X PixelConceptqh…qi}qj(hUhhdubah hVubh5Xd, all other GIL classes and algorithms can be used with it. See more about concepts is avaialble at qk…ql}qm(hXd, all other GIL classes and algorithms can be used with it. See more about concepts is avaialble at hh:ubcdocutils.nodes reference qn)qo}qp(hXŠ`Generic Programming in ConceptC++ `_h"}qq(UnameX!Generic Programming in ConceptC++UrefuriqrXchttps://web.archive.org/web/20160324115943/http://www.generic-programming.org/languages/conceptcpp/qsh']h&]h$]h%]h)]uhh:h]qth5X!Generic Programming in ConceptC++qu…qv}qw(hUhhoubah U referenceqxubcdocutils.nodes target qy)qz}q{(hXf U referencedq|Khh:h Utargetq}h"}q~(Urefurihsh']qhah&]h$]h%]h)]q€hauh]ubeubh9)q}q‚(hXÉIn this document we will use a syntax for defining concepts that is described in the C++ standard proposal paper `[N2081] Concepts `_.hhhhh h`_h"}qŠ(UnameX[N2081] ConceptshrXAhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2081.pdfq‹h']h&]h$]h%]h)]uhhh]qŒh5X[N2081] Conceptsq…qŽ}q(hUhhˆubah hxubhy)q}q‘(hXD h|Khhh h}h"}q’(Urefurih‹h']q“hah&]h$]h%]h)]q”hauh]ubh5X.…q•}q–(hX.hhubeubh9)q—}q˜(hXçHere are some common concepts that will be used in GIL. Most of them are defined at the `ConceptC++ Concept Web `_:hhhhh h`_h"}q (UnameXConceptC++ Concept WebhrXrhttps://web.archive.org/web/20160326060858/http://www.generic-programming.org/languages/conceptcpp/concept_web.phpq¡h']h&]h$]h%]h)]uhh—h]q¢h5XConceptC++ Concept Webq£…q¤}q¥(hUhhžubah hxubhy)q¦}q§(hXu h|Khh—h h}h"}q¨(Urefurih¡h']q©hah&]h$]h%]h)]qªhauh]ubh5X:…q«}q¬(hX:hh—ubeubcdocutils.nodes literal_block q­)q®}q¯(hX^auto concept DefaultConstructible { T::T(); }; auto concept CopyConstructible { T::T(T); T::~T(); }; auto concept Assignable { typename result_type; result_type operator=(T&, U); }; auto concept EqualityComparable { bool operator==(T x, U y); bool operator!=(T x, U y) { return !(x==y); } }; concept SameType { /* unspecified */ }; template concept_map SameType { /* unspecified */ }; auto concept Swappable { void swap(T& t, T& u); };hhhhh U literal_blockq°h"}q±(Ulinenosq²‰Ulanguageq³XcppU xml:spaceq´Upreserveqµh']h&]h$]Uhighlight_argsq¶}h%]h)]uh+Kh,hh]q·h5X^auto concept DefaultConstructible { T::T(); }; auto concept CopyConstructible { T::T(T); T::~T(); }; auto concept Assignable { typename result_type; result_type operator=(T&, U); }; auto concept EqualityComparable { bool operator==(T x, U y); bool operator!=(T x, U y) { return !(x==y); } }; concept SameType { /* unspecified */ }; template concept_map SameType { /* unspecified */ }; auto concept Swappable { void swap(T& t, T& u); };q¸…q¹}qº(hUhh®ubaubh9)q»}q¼(hX7Here are some additional basic concepts that GIL needs:q½hhhhh h : DefaultConstructible, CopyConstructible, EqualityComparable, Assignable, Swappable {}; auto concept Metafunction { typename type; };hhhhh h°h"}qÅ(h²‰h³Xcpph´hµh']h&]h$]h¶}h%]h)]uh+K9h,hh]qÆh5XÛauto concept Regular : DefaultConstructible, CopyConstructible, EqualityComparable, Assignable, Swappable {}; auto concept Metafunction { typename type; };qÇ…qÈ}qÉ(hUhhÃubaubeubahUU transformerqÊNU footnote_refsqË}qÌUrefnamesqÍ}qÎUsymbol_footnotesqÏ]qÐUautofootnote_refsqÑ]qÒUsymbol_footnote_refsqÓ]qÔU citationsqÕ]qÖh,hU current_lineq×NUtransform_messagesqØ]qÙUreporterqÚNUid_startqÛKU autofootnotesqÜ]qÝU citation_refsqÞ}qßUindirect_targetsqà]qáUsettingsqâ(cdocutils.frontend Values qãoqä}qå(Ufootnote_backlinksqæKUrecord_dependenciesqçNU rfc_base_urlqèUhttps://tools.ietf.org/html/qéU tracebackqêˆUpep_referencesqëNUstrip_commentsqìNU toc_backlinksqíUentryqîU language_codeqïUenqðU datestampqñNU report_levelqòKU _destinationqóNU halt_levelqôKU strip_classesqõNh2NUerror_encoding_error_handlerqöUbackslashreplaceq÷UdebugqøNUembed_stylesheetqù‰Uoutput_encoding_error_handlerqúUstrictqûU sectnum_xformqüKUdump_transformsqýNU docinfo_xformqþKUwarning_streamqÿNUpep_file_url_templaterUpep-%04drUexit_status_levelrKUconfigrNUstrict_visitorrNUcloak_email_addressesrˆUtrim_footnote_reference_spacer‰UenvrNUdump_pseudo_xmlrNUexpose_internalsr NUsectsubtitle_xformr ‰U source_linkr NUrfc_referencesr NUoutput_encodingr Uutf-8rU source_urlrNUinput_encodingrU utf-8-sigrU_disable_configrNU id_prefixrUU tab_widthrKUerror_encodingrUasciirU_sourcerhUgettext_compactrˆU generatorrNUdump_internalsrNU smart_quotesr‰U pep_base_urlrU https://www.python.org/dev/peps/rUsyntax_highlightrUlongrUinput_encoding_error_handlerr hûUauto_id_prefixr!Uidr"Udoctitle_xformr#‰Ustrip_elements_with_classesr$NU _config_filesr%]r&Ufile_insertion_enabledr'ˆU raw_enabledr(KU dump_settingsr)NubUsymbol_footnote_startr*KUidsr+}r,(hhzhhhh¦hhuUsubstitution_namesr-}r.h h,h"}r/(h$]h']h&]Usourcehh%]h)]uU footnotesr0]r1Urefidsr2}r3ub.