{"id":71,"date":"2006-04-16T22:40:03","date_gmt":"2006-04-16T20:40:03","guid":{"rendered":"https:\/\/alax.info\/blog\/71"},"modified":"2006-04-17T01:36:46","modified_gmt":"2006-04-16T23:36:46","slug":"atl-sorting-templates","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/71","title":{"rendered":"ATL sorting templates"},"content":{"rendered":"<p>Active Template Library (ATL) contains a lot of useful classes <a href=\"http:\/\/groups.google.com\/group\/microsoft.public.vc.atl\/browse_thread\/thread\/88c39c201405bc5e\">but not for sorting<\/a>. There are collections classes, including <span style=\"font-style: italic\">CAtlArray <\/span>but it does not have sorting capabilities.<\/p>\n<p>I would like to share quite simple C++ templates that sort.<\/p>\n<p><!--more-->The sample projects illustrates 3 sorting cases:<\/p>\n<ol>\n<li>Array of ordinal values that compare one to another; sorting uses comparison operator to order values.<\/li>\n<li>Array of complex values that do not compare one to another directly and a custom comparison function is required; sorting uses &#8220;traits&#8221; class to perform such comparison.<\/li>\n<li>Array of references (indexes, pointers); &#8220;traits&#8221; class is provided to sort function along with custom parameter which is also passed to comparison function.<\/li>\n<\/ol>\n<p>Sample project source code: <a id=\"p70\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/04\/ATL%20Sort.zip\">ATL Sort.zip<\/a> \/\/ VC++.NET 2003, Console application project with ATL support<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Active Template Library (ATL) contains a lot of useful classes but not for sorting. There are collections classes, including CAtlArray but it does not have sorting capabilities. I would like to share quite simple C++ templates that sort.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-atl","category-source"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}