{"action":"created","issue":{"url":"https://api.github.com/repos/niXman/yas/issues/42","repository_url":"https://api.github.com/repos/niXman/yas","labels_url":"https://api.github.com/repos/niXman/yas/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/niXman/yas/issues/42/comments","events_url":"https://api.github.com/repos/niXman/yas/issues/42/events","html_url":"https://github.com/niXman/yas/issues/42","id":387755743,"node_id":"MDU6SXNzdWUzODc3NTU3NDM=","number":42,"title":"error C2760: syntax error on Visual studio 2017","user":{"login":"karan-k-deepr","id":35223688,"node_id":"MDQ6VXNlcjM1MjIzNjg4","avatar_url":"https://avatars0.githubusercontent.com/u/35223688?v=4","gravatar_id":"","url":"https://api.github.com/users/karan-k-deepr","html_url":"https://github.com/karan-k-deepr","followers_url":"https://api.github.com/users/karan-k-deepr/followers","following_url":"https://api.github.com/users/karan-k-deepr/following{/other_user}","gists_url":"https://api.github.com/users/karan-k-deepr/gists{/gist_id}","starred_url":"https://api.github.com/users/karan-k-deepr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karan-k-deepr/subscriptions","organizations_url":"https://api.github.com/users/karan-k-deepr/orgs","repos_url":"https://api.github.com/users/karan-k-deepr/repos","events_url":"https://api.github.com/users/karan-k-deepr/events{/privacy}","received_events_url":"https://api.github.com/users/karan-k-deepr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-12-05T13:25:35Z","updated_at":"2018-12-06T09:14:53Z","closed_at":"2018-12-05T14:32:41Z","author_association":"NONE","body":"Hello Everyone,\r\nI am using `Visual Studio 2017` on `Windows`.  Initially, I have created some examples code and it was working fine.\r\nBut when I add them into my code then it gives me many syntax errors.\r\n```\r\n1>yas\\detail\\tools\\limit.hpp(69): warning C4003: not enough arguments for function-like macro invocation 'max'\r\n1>yas\\detail\\tools\\limit.hpp(69): error C2760: syntax error: unexpected token '(', expected 'id-expression'\r\n1>yas\\detail\\tools\\limit.hpp(83): note: see reference to class template instantiation 'yas::max_limit<T>' being compiled\r\n1>yas\\detail\\tools\\limit.hpp(69): error C2143: syntax error: missing ')' before '>'\r\n1>yas\\detail\\tools\\limit.hpp(69): error C2059: syntax error: '>'\r\n1>yas\\detail\\tools\\limit.hpp(69): error C2059: syntax error: ')'\r\n1>yas\\detail\\tools\\limit.hpp(69): error C2334: unexpected token(s) preceding ':'; skipping apparent function body\r\n1>yas\\detail\\tools\\limit.hpp(83): fatal error C1903: unable to recover from previous error(s); stopping compilation\r\n```\r\n\r\nI have resolved all the above issues, but please give it a look if everything is fine.\r\nI have changed `header.hpp`\r\n`constexpr std::uint8_t d = std::numeric_limits<std::uint8_t>::max();`\r\nwith\r\n`constexpr std::uint8_t d = (std::numeric_limits<std::uint8_t>::max)();`\r\n\r\nand in `limit.hpp` FROM\r\n```\r\ntemplate<typename T>\r\nstruct max_limit {\r\n    using type = typename limit_base<T>::type;\r\n\r\n    max_limit(const max_limit &) = delete;\r\n    max_limit& operator=(const max_limit &) = delete;\r\n\r\n    constexpr max_limit(T &&v, std::uint64_t max)\r\n        :val(std::forward<type>(v))\r\n         ,max(max)\r\n\t{}\r\n    constexpr max_limit(max_limit &&r)\r\n        :val(std::forward<type>(r.val))\r\n        ,max(r.max)\r\n\t{}\r\n\r\n    template<typename L, typename V>\r\n    bool check(const L l, const V &) const {\r\n        return __YAS_SCAST(std::uint64_t, l) <= max;\r\n    }\r\n\r\n    type val;\r\n    const std::uint64_t max;\r\n};\r\ntemplate<typename T>\r\nstruct minmax_limit {\r\n    using type = typename limit_base<T>::type;\r\n\r\n    minmax_limit(const minmax_limit &) = delete;\r\n    minmax_limit& operator=(const minmax_limit &) = delete;\r\n\r\n    constexpr minmax_limit(T &&v, std::uint64_t min, std::uint64_t max)\r\n        :val(std::forward<type>(v))\r\n        ,min(min)\r\n        ,max(max)\r\n\t{}\r\n    constexpr minmax_limit(minmax_limit &&r)\r\n        :val(std::forward<type>(r.val))\r\n        ,min(r.min)\r\n        ,max(r.max)\r\n\t{}\r\n\r\n    template<typename L, typename V>\r\n    bool check(const L l, const V &) const {\r\n        return (min <= __YAS_SCAST(std::uint64_t, l) && __YAS_SCAST(std::uint64_t, l) <= max);\r\n    }\r\n\r\n    type val;\r\n    const std::uint64_t min;\r\n    const std::uint64_t max;\r\n};\r\n```\r\nWITH\r\n```\r\n\r\ntemplate<typename T>\r\nstruct max_limit {\r\n    using type = typename limit_base<T>::type;\r\n\r\n    max_limit(const max_limit &) = delete;\r\n    max_limit& operator=(const max_limit &) = delete;\r\n\r\n    constexpr max_limit(T &&v, std::uint64_t max)\r\n        :val(std::forward<type>(v))\r\n\t{ this->max = max; }\r\n    constexpr max_limit(max_limit &&r)\r\n        :val(std::forward<type>(r.val))\r\n\t{ this->max = r.max; }\r\n\r\n    template<typename L, typename V>\r\n    bool check(const L l, const V &) const {\r\n        return __YAS_SCAST(std::uint64_t, l) <= this->max;\r\n    }\r\n\r\n    type val;\r\n    const std::uint64_t max;\r\n};\r\ntemplate<typename T>\r\nstruct minmax_limit {\r\n    using type = typename limit_base<T>::type;\r\n\r\n    minmax_limit(const minmax_limit &) = delete;\r\n    minmax_limit& operator=(const minmax_limit &) = delete;\r\n\r\n    constexpr minmax_limit(T &&v, std::uint64_t min, std::uint64_t max)\r\n        :val(std::forward<type>(v))\r\n\t{\r\n\t\tthis->min = min; this->max = max;\r\n\t}\r\n    constexpr minmax_limit(minmax_limit &&r)\r\n        :val(std::forward<type>(r.val))\r\n\t{\r\n\t\tthis->min = r.min; this.max = r.max;\r\n\t}\r\n\r\n    template<typename L, typename V>\r\n    bool check(const L l, const V &) const {\r\n        return (this->min <= __YAS_SCAST(std::uint64_t, l) && __YAS_SCAST(std::uint64_t, l) <= this->max);\r\n    }\r\n\r\n    type val;\r\n    const std::uint64_t min;\r\n    const std::uint64_t max;\r\n};\r\n```\r\n\r\nIf everything is fine, then can you please change it in next release."},"comment":{"url":"https://api.github.com/repos/niXman/yas/issues/comments/444802827","html_url":"https://github.com/niXman/yas/issues/42#issuecomment-444802827","issue_url":"https://api.github.com/repos/niXman/yas/issues/42","id":444802827,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDgwMjgyNw==","user":{"login":"niXman","id":518474,"node_id":"MDQ6VXNlcjUxODQ3NA==","avatar_url":"https://avatars2.githubusercontent.com/u/518474?v=4","gravatar_id":"","url":"https://api.github.com/users/niXman","html_url":"https://github.com/niXman","followers_url":"https://api.github.com/users/niXman/followers","following_url":"https://api.github.com/users/niXman/following{/other_user}","gists_url":"https://api.github.com/users/niXman/gists{/gist_id}","starred_url":"https://api.github.com/users/niXman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niXman/subscriptions","organizations_url":"https://api.github.com/users/niXman/orgs","repos_url":"https://api.github.com/users/niXman/repos","events_url":"https://api.github.com/users/niXman/events{/privacy}","received_events_url":"https://api.github.com/users/niXman/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T09:14:53Z","updated_at":"2018-12-06T09:14:53Z","author_association":"OWNER","body":"Okay, thanks.\r\n\r\nClosed.\r\n"}}
{"actor":{"display_login":"niXman"}}