File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Sources/OpenAttributeGraph/Attribute/Attribute Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -289,11 +289,27 @@ extension Attribute {
289289 }
290290 }
291291
292+ public init < R: Rule > ( _ rule: R , initialValue: Value ) where R. Value == Value {
293+ self = withUnsafePointer ( to: rule) { pointer in
294+ withUnsafePointer ( to: initialValue) { initialValuePointer in
295+ Attribute ( body: pointer, value: initialValuePointer) { R . _update }
296+ }
297+ }
298+ }
299+
292300 public init < R: StatefulRule > ( _ rule: R ) where R. Value == Value {
293301 self = withUnsafePointer ( to: rule) { pointer in
294302 Attribute ( body: pointer, value: nil ) { R . _update }
295303 }
296304 }
305+
306+ public init < R: StatefulRule > ( _ rule: R , initialValue: Value ) where R. Value == Value {
307+ self = withUnsafePointer ( to: rule) { pointer in
308+ withUnsafePointer ( to: initialValue) { initialValuePointer in
309+ Attribute ( body: pointer, value: initialValuePointer) { R . _update }
310+ }
311+ }
312+ }
297313}
298314
299315@_silgen_name ( " OAGGraphCreateAttribute " )
You can’t perform that action at this time.
0 commit comments