On Thursday, 1 October 2015 at 22:37:57 UTC, Ali Çehreli wrote:
template allSame(V...)
if (isExpressions!(V))
{
bool impl_(V...)() {
static if (V.length > 1) {
foreach (i, _; V[0 .. $ - 1]) {
if (V[i] != V[i + 1]) {
return false;
On Friday, 2 October 2015 at 08:13:00 UTC, John Colvin wrote:
On Thursday, 1 October 2015 at 22:26:39 UTC, Nordlöw wrote:
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote:
[...]
Thanks!
BTW: Is there some way to turn the recursive definition of
`allSame`
template
On Thursday, 1 October 2015 at 22:26:39 UTC, Nordlöw wrote:
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote:
/** Returns: true iff all values $(D V) are the same. */
template allSame(V...) // TODO restrict to values
only
{
static if (V.length <= 1)
enum
On Friday, 2 October 2015 at 07:52:22 UTC, Nordlöw wrote:
On Friday, 2 October 2015 at 02:39:56 UTC, Meta wrote:
Highly doubtful as CTFE already allocates like there's no
tomorrow.
Could that memory usage be tested somehow?
Your favourite process monitor I guess.
On Friday, 2 October 2015 at 18:52:22 UTC, Nordlöw wrote:
On Friday, 2 October 2015 at 16:21:22 UTC, Meta wrote:
Could that memory usage be tested somehow?
Your favourite process monitor I guess.
Any suggestions on an evil D snippet that stress tests
different implementations of the above
On Friday, 2 October 2015 at 16:21:22 UTC, Meta wrote:
Could that memory usage be tested somehow?
Your favourite process monitor I guess.
Any suggestions on an evil D snippet that stress tests different
implementations of the above mentioned traits?
On Friday, 2 October 2015 at 02:39:56 UTC, Meta wrote:
Highly doubtful as CTFE already allocates like there's no
tomorrow.
Could that memory usage be tested somehow?
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote:
/** Returns: true iff all values $(D V) are the same. */
template allSame(V...) // TODO restrict to values only
{
static if (V.length <= 1)
enum bool allSame = true;
else
enum bool allSame = V[0] ==
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote:
/** Returns: true iff all values $(D V) are the same. */
template allSame(V...) // TODO restrict to values only
{
static if (V.length <= 1)
enum bool allSame = true;
else
enum bool allSame = V[0] ==
On 10/01/2015 03:26 PM, Nordlöw wrote:
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote:
/** Returns: true iff all values $(D V) are the same. */
template allSame(V...) // TODO restrict to values only
{
static if (V.length <= 1)
enum bool allSame = true;
On Thursday, 1 October 2015 at 22:37:57 UTC, Ali Çehreli wrote:
Very quickly:
import std.traits;
template allSame(V...)
if (isExpressions!(V))
{
bool impl_(V...)() {
static if (V.length > 1) {
foreach (i, _; V[0 .. $ - 1]) {
if (V[i] != V[i + 1]) {
On Thursday, 1 October 2015 at 22:41:21 UTC, Nordlöw wrote:
Will this spare memory in DMD? If so there are a few traits
that should be update accordingly, for instance `allSatisfy`
and `anySatisfy`.
Thanks!
Highly doubtful as CTFE already allocates like there's no
tomorrow.
On Thursday, 1 October 2015 at 00:04:18 UTC, Nordlöw wrote:
How do I check that a template parameter is a CT-value or an
enum symbol?
I want this to restrict the following template:
/** Returns: true iff all values $(D V) are the same. */
template allSame(V...) // TODO restrict to
13 matches
Mail list logo