{"action":"created","issue":{"url":"https://api.github.com/repos/g-truc/glm/issues/465","labels_url":"https://api.github.com/repos/g-truc/glm/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/g-truc/glm/issues/465/comments","events_url":"https://api.github.com/repos/g-truc/glm/issues/465/events","html_url":"https://github.com/g-truc/glm/issues/465","id":122689594,"number":465,"title":"Non trivially copyable instantiations","user":{"login":"nkyriazis","id":13269427,"avatar_url":"https://avatars.githubusercontent.com/u/13269427?v=3","gravatar_id":"","url":"https://api.github.com/users/nkyriazis","html_url":"https://github.com/nkyriazis","followers_url":"https://api.github.com/users/nkyriazis/followers","following_url":"https://api.github.com/users/nkyriazis/following{/other_user}","gists_url":"https://api.github.com/users/nkyriazis/gists{/gist_id}","starred_url":"https://api.github.com/users/nkyriazis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkyriazis/subscriptions","organizations_url":"https://api.github.com/users/nkyriazis/orgs","repos_url":"https://api.github.com/users/nkyriazis/repos","events_url":"https://api.github.com/users/nkyriazis/events{/privacy}","received_events_url":"https://api.github.com/users/nkyriazis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/g-truc/glm/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T08:53:23Z","updated_at":"2016-01-03T16:24:04Z","closed_at":"2016-01-03T16:24:04Z","body":"Understandably, GLM targets scalar instantiations of its templated types. Therefore, this issue might be of limited interest.\r\n\r\nIf a type with non-trivial copy constructor is used to instantiate e.g. glm::tvec4, then, in MSVC2013, the following compilation error occurs:\r\n\r\n```\r\nError 1 error C2621: 'glm::tvec4<std::string,0>::data' : illegal union member; type 'XXX' has a copy constructor glm\\glm\\detail\\type_vec4.hpp 143\r\n```\r\n\r\nA simple example to reproduce this error:\r\n\r\n```cpp\r\n#include <glm/glm.hpp>\r\n#include <string>\r\n\r\nvoid test()\r\n{\r\n    glm::tvec4<std::string> vec;\r\n}\r\n```\r\n\r\nThere is little reason behind using a string as a scalar, but this serves only as an example. In general (but also in my case) one might want to use complex scalar representations, which generates an error [here](https://github.com/g-truc/glm/blob/master/glm/detail/type_vec4.hpp#L143).\r\n\r\nThis is a type-dependent issue, so it seems appropriate to treat it with type-dependent compile-time selection of storage. E.g. typedef or derive storage as a function of type T."},"comment":{"url":"https://api.github.com/repos/g-truc/glm/issues/comments/168516025","html_url":"https://github.com/g-truc/glm/issues/465#issuecomment-168516025","issue_url":"https://api.github.com/repos/g-truc/glm/issues/465","id":168516025,"user":{"login":"Groovounet","id":367227,"avatar_url":"https://avatars.githubusercontent.com/u/367227?v=3","gravatar_id":"","url":"https://api.github.com/users/Groovounet","html_url":"https://github.com/Groovounet","followers_url":"https://api.github.com/users/Groovounet/followers","following_url":"https://api.github.com/users/Groovounet/following{/other_user}","gists_url":"https://api.github.com/users/Groovounet/gists{/gist_id}","starred_url":"https://api.github.com/users/Groovounet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Groovounet/subscriptions","organizations_url":"https://api.github.com/users/Groovounet/orgs","repos_url":"https://api.github.com/users/Groovounet/repos","events_url":"https://api.github.com/users/Groovounet/events{/privacy}","received_events_url":"https://api.github.com/users/Groovounet/received_events","type":"User","site_admin":false},"created_at":"2016-01-03T16:24:04Z","updated_at":"2016-01-03T16:24:04Z","body":"Erm, I don't really understand the issue. GLM types only accept basic typenames: float, integer and bool and that it.\r\n\r\nThanks,\r\nChristophe"}}