aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2018-12-31 08:44:14 -0800
committerapache <apache@e5-web1.enlightenment.org>2018-12-31 08:44:14 -0800
commitf9aff55d38f93ee7d33726b6f57e36e21985d52a (patch)
tree0d44614e5f43d13ebf2d5a23222a00cf850af85d
parentWiki page generic-value.md changed with summary [workaround a dokuwiki render... (diff)
downloadwww-content-f9aff55d38f93ee7d33726b6f57e36e21985d52a.tar.gz
Wiki page generic-value.md changed with summary [Added implicit conversions] by Xavi Artigas
-rw-r--r--pages/develop/guides/csharp/eina/generic-value.md.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/pages/develop/guides/csharp/eina/generic-value.md.txt b/pages/develop/guides/csharp/eina/generic-value.md.txt
index e4f3f5f11..fe8968755 100644
--- a/pages/develop/guides/csharp/eina/generic-value.md.txt
+++ b/pages/develop/guides/csharp/eina/generic-value.md.txt
@@ -145,9 +145,24 @@ v1.Set(7);
string str = v1.ToString();
```
+### Implicit Conversions ###
+
+For convenience, implicit conversion operators also exist between an `eina.Value` and the actual stored type, so operations like these are possible:
+
+```csharp
+eina.Value int_val = 123;
+eina.Value str_val = "My string";
+int i = int_val;
+string str = str_val;
+```
+These conversions allow directly providing native values to EFL methods expecting an `eina.Value`, for example.
+
+> **NOTE:**
+> As with all implicit conversions, use with caution to make sure the compiler is actually choosing the types you expect.
+
## Aggregate Values ##
-`eina.Value` supports handling collections of simple values through the aggregate types `eina.ValueType.Array`, `eina.ValueType.List` and: `eina.ValueType.Hash`.
+`eina.Value` supports handling collections of simple values through the aggregate types `eina.ValueType.Array`, `eina.ValueType.List` and `eina.ValueType.Hash`.
All aggregate types allow the operations for simple types described above as well as some specific methods, typically involving construction and access to particular elements within the collection.