{"action":"closed","issue":{"url":"https://api.github.com/repos/SwiftBond/Bond/issues/49","labels_url":"https://api.github.com/repos/SwiftBond/Bond/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/SwiftBond/Bond/issues/49/comments","events_url":"https://api.github.com/repos/SwiftBond/Bond/issues/49/events","html_url":"https://github.com/SwiftBond/Bond/issues/49","id":68972500,"number":49,"title":"Common Protocol for all Dynamic<T> classes?","user":{"login":"rvangraan","id":2574318,"avatar_url":"https://avatars.githubusercontent.com/u/2574318?v=3","gravatar_id":"","url":"https://api.github.com/users/rvangraan","html_url":"https://github.com/rvangraan","followers_url":"https://api.github.com/users/rvangraan/followers","following_url":"https://api.github.com/users/rvangraan/following{/other_user}","gists_url":"https://api.github.com/users/rvangraan/gists{/gist_id}","starred_url":"https://api.github.com/users/rvangraan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvangraan/subscriptions","organizations_url":"https://api.github.com/users/rvangraan/orgs","repos_url":"https://api.github.com/users/rvangraan/repos","events_url":"https://api.github.com/users/rvangraan/events{/privacy}","received_events_url":"https://api.github.com/users/rvangraan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SwiftBond/Bond/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-16T17:34:12Z","updated_at":"2015-06-23T11:59:19Z","closed_at":"2015-06-23T11:59:19Z","body":"Hi there,\r\n\r\nis there a possibility that you can introduce an empty protocol that all the Dynamic<T> types implement, similar to this? \r\n```\r\nprotocol DynamicProtocol {}\r\n\r\npublic class Dynamic<T> : DynamicProtocol {\r\n}\r\n```\r\n\r\nWe would like to declare an array or set that can store the dynamic instances, but can't do that if they don't all have a common extension.\r\n\r\nWe have this kind of thing in our code base:\r\n\r\n```\r\n    private description: String = \"\"\r\n    private var dynDescription = Dynamic(description)\r\n    private var dynNetAmount = Dynamic(Money())\r\n    private var dynVatAmount = Dynamic(Money())\r\n   ...\r\n```\r\n\r\nand it would be really cool if we can declare a container like this that store any Dynamic<T> instance:\r\n\r\n```\r\nvar dynamicValues : [ ValueType: DynamicProtocol ]\r\ndynamicValues[.description] = dynDescription\r\ndynamicValues[.vatAmount] = dynVatAmount\r\n...\r\n```\r\nWe cannot do this at the moment because of the generic Dynamic<T> type, but it will be possible all the Dynamic classes implement a single protocol without methods.\r\n\r\nThanks,\r\n\r\nR"}}