{"id":34295,"date":"2021-11-26T15:00:35","date_gmt":"2021-11-26T20:00:35","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=34295"},"modified":"2021-11-26T15:00:35","modified_gmt":"2021-11-26T20:00:35","slug":"metal-cpp","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2021\/11\/26\/metal-cpp\/","title":{"rendered":"Metal-cpp"},"content":{"rendered":"<p><a href=\"https:\/\/developer.apple.com\/metal\/cpp\/\">Apple<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=29289761\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/developer.apple.com\/metal\/cpp\/\"><p>Metal-cpp is a low-overhead C++ interface for Metal that helps developers add Metal functionality to graphics apps, games, and game engines that are written in C++.<\/p>\n<p>[&#8230;]<\/p>\n<p>No measurable overhead compared to calling Metal Objective-C headers, due to inlining of C++ function calls.<\/p>\n<p>[&#8230;]<\/p>\n<p>For convenience, you can alternatively use metal-cpp as a single-header include in your project.<\/p>\n<p>[&#8230;]<\/p>\n<p>Metal-cpp follows the object allocation policies of Cocoa and Cocoa Touch. Understanding those rules is especially important when using metal-cpp because C++ objects are not eligible for automatic reference counting (ARC).<\/p><\/blockquote>\n<p>It&rsquo;s not often that Apple encourages using C++.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2014\/10\/08\/the-source-of-technote-2034\/\">The Source of Technote #2034<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Apple (via Hacker News): Metal-cpp is a low-overhead C++ interface for Metal that helps developers add Metal functionality to graphics apps, games, and game engines that are written in C++. [&#8230;] No measurable overhead compared to calling Metal Objective-C headers, due to inlining of C++ function calls. [&#8230;] For convenience, you can alternatively use metal-cpp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2021-11-26T20:00:38Z","apple_news_api_id":"23509a2e-ccd3-4006-b90c-747e998b45e0","apple_news_api_modified_at":"2021-11-26T20:00:39Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AI1CaLszTQAa5DHR-mYtF4A","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[326,31,2078,30,2077,571,906,71],"class_list":["post-34295","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c-plus-plus","tag-ios","tag-ios-15","tag-mac","tag-macos-12","tag-memory-management","tag-metal","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=34295"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34295\/revisions"}],"predecessor-version":[{"id":34296,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34295\/revisions\/34296"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=34295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=34295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=34295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}