vibe.d beta banner
get vibe.d
0.10.1

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

Struct Confirm

Ensures that the parameter value matches that of another parameter.

struct Confirm(string CONFIRMED_PARAM) ;

Fields

NameTypeDescription
m_value string

Methods

NameDescription
fromString (str)
toString ()

Example

class WebService {
	void setPassword(ValidPassword password, Confirm!"password" password_confirmation)
	{
		// password is valid and guaranteed to equal password_confirmation
	}

	void setProfileInfo(string full_name, Nullable!ValidPassword password, Nullable!(Confirm!"password") password_confirmation)
	{
		// Password is valid and guaranteed to equal password_confirmation
		// It is allowed for both, password and password_confirmation
		// to be absent at the same time, but not for only one of them.
	}
}
Authors

Sönke Ludwig

Copyright

© 2014 Sönke Ludwig

License

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