{"comment":{"url":"https://api.github.com/repos/stereomatchingkiss/tiny-cnn/comments/15892176","html_url":"https://github.com/stereomatchingkiss/tiny-cnn/commit/ade9ead0ce8480c978f6052faba36f80b08f5303#commitcomment-15892176","id":15892176,"user":{"login":"stereomatchingkiss","id":1801914,"avatar_url":"https://avatars.githubusercontent.com/u/1801914?v=3","gravatar_id":"","url":"https://api.github.com/users/stereomatchingkiss","html_url":"https://github.com/stereomatchingkiss","followers_url":"https://api.github.com/users/stereomatchingkiss/followers","following_url":"https://api.github.com/users/stereomatchingkiss/following{/other_user}","gists_url":"https://api.github.com/users/stereomatchingkiss/gists{/gist_id}","starred_url":"https://api.github.com/users/stereomatchingkiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stereomatchingkiss/subscriptions","organizations_url":"https://api.github.com/users/stereomatchingkiss/orgs","repos_url":"https://api.github.com/users/stereomatchingkiss/repos","events_url":"https://api.github.com/users/stereomatchingkiss/events{/privacy}","received_events_url":"https://api.github.com/users/stereomatchingkiss/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"ade9ead0ce8480c978f6052faba36f80b08f5303","created_at":"2016-02-04T17:14:22Z","updated_at":"2016-02-04T17:14:22Z","body":">Is there a good reason to prefer it against a plain\r\nif (parallelize) <true case> else <false case>\r\nin this context?\r\n\r\nThe reason is efficiency, normal if...else may give big impact of run time cost if the branch prediction fail, but using true_type and false_type, you can guarantee the compiler can find out which function to choose at compile time. To make it readable, it is better to define another types, like \r\n\r\n```\r\nstruct is_int\r\n{\r\n};\r\n\r\nstruct non_int\r\n{\r\n};\r\n```\r\n"}}