vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Function Collection.opIndex

Accesses a single collection entry.

Collection.Item opIndex (
  Collection.ItemID id
);

Example

interface IMain {
	@property Collection!IItem items();
}

interface IItem {
	struct CollectionIndices {
		int _itemID;
	}

	@method(HTTPMethod.GET)
	string name(int _itemID);
}

void test(IMain main)
{
	auto item_name = main.items[23].name; // equivalent to IItem.name(23)
}
Authors

Sönke Ludwig, Михаил Страшун, Mathias 'Geod24' Lang

Copyright

© 2012-2018 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.