{"action":"created","issue":{"url":"https://api.github.com/repos/edouarda/brigand/issues/127","repository_url":"https://api.github.com/repos/edouarda/brigand","labels_url":"https://api.github.com/repos/edouarda/brigand/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/edouarda/brigand/issues/127/comments","events_url":"https://api.github.com/repos/edouarda/brigand/issues/127/events","html_url":"https://github.com/edouarda/brigand/issues/127","id":136162154,"number":127,"title":"remove_if has max instantiation depth issues ","user":{"login":"porkybrain","id":10760132,"avatar_url":"https://avatars.githubusercontent.com/u/10760132?v=3","gravatar_id":"","url":"https://api.github.com/users/porkybrain","html_url":"https://github.com/porkybrain","followers_url":"https://api.github.com/users/porkybrain/followers","following_url":"https://api.github.com/users/porkybrain/following{/other_user}","gists_url":"https://api.github.com/users/porkybrain/gists{/gist_id}","starred_url":"https://api.github.com/users/porkybrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porkybrain/subscriptions","organizations_url":"https://api.github.com/users/porkybrain/orgs","repos_url":"https://api.github.com/users/porkybrain/repos","events_url":"https://api.github.com/users/porkybrain/events{/privacy}","received_events_url":"https://api.github.com/users/porkybrain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-02-24T19:27:38Z","updated_at":"2016-02-29T18:36:25Z","closed_at":null,"body":"Since its recursive it will only go to about 250 elemts on clang and 500 elements on MSVC. Its not so trivial to fast track though since both removing most elements and removing only a few elements are possible scenarios.\r\n\r\nI think the strategy of dealing with the last test results and testing the next type (and sometimes fast track) all at once strategy I have been using is not so suited this time. Since we are going to do at least N instantiations fo the predicate we could just do them once with pack expantion and pass the result together with the inputs to the recursive function, that would make it easier to write the recursion and then just do pattern matching on 8 falses or 8 trues as a fast track. The problem is that the instantiation depth would then be very dependent on the data and thus far less deterministic. \r\n\r\nWhat do you guys think?\r\n\r\nOn a side note I wonder if exploiting the fact that `x{(Ts*)0...}` could be either a call to a constructor with a variadic pack if types are different or a call to a constructor with an initializer list when all type are the same could add some speed to `all` or `none`.\r\n\r\n```C++\r\n\r\nstruct AllSameType {\r\n\tbool value;\r\n\tconstexpr AllSameType(...) :value{ false } {}\r\n\ttemplate<typename T>\r\n\tconstexpr AllSameType(std::initializer_list<T>) : value{ true } {}\r\n};\r\n\r\ntemplate<typename...Ts>\r\nconstexpr bool all_same() {\r\n\treturn AllSameType{ ((Ts*)0)... }.value;\r\n}\r\n\r\nstatic_assert(all_same<int, int, int>(), \"\");\r\nstatic_assert(!all_same<bool, int, float>(), \"\");\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/edouarda/brigand/issues/comments/190324368","html_url":"https://github.com/edouarda/brigand/issues/127#issuecomment-190324368","issue_url":"https://api.github.com/repos/edouarda/brigand/issues/127","id":190324368,"user":{"login":"porkybrain","id":10760132,"avatar_url":"https://avatars.githubusercontent.com/u/10760132?v=3","gravatar_id":"","url":"https://api.github.com/users/porkybrain","html_url":"https://github.com/porkybrain","followers_url":"https://api.github.com/users/porkybrain/followers","following_url":"https://api.github.com/users/porkybrain/following{/other_user}","gists_url":"https://api.github.com/users/porkybrain/gists{/gist_id}","starred_url":"https://api.github.com/users/porkybrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porkybrain/subscriptions","organizations_url":"https://api.github.com/users/porkybrain/orgs","repos_url":"https://api.github.com/users/porkybrain/repos","events_url":"https://api.github.com/users/porkybrain/events{/privacy}","received_events_url":"https://api.github.com/users/porkybrain/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T18:36:25Z","updated_at":"2016-02-29T18:36:25Z","body":"@brunocodutra the Kvasir library encodes chip specific SFR rules into types and performs lazy evaluation and optimization on lists of these types at compile time. One thing with huge (10x) optimization potential is the initialization during boot up of these small chips, however on a big design that can mean 2k register interactions all in one list. Thats what I'm working towards. Also I could imagine state machines with more than 1k of possible transitions (especially if one make the declaration of state machines sexier). \r\nI think the use cases for fast MPL libs are missing because fast MPL libs are missing. \r\nDon't get me wrong I like your lib a lot, I'm just playing the contrarian."}}