AES_set_decrypt_key is needed before AES_decrypt.
AES_set_decrypt_key(chunk.ptr, 128, &wctx);
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 = ['z', 'g', 'c'];
sort(arr2); // error
sort!q{ a[0] > b[0] }(zip(arr, arr2)); // error
}
---
I don't know what's d
On Monday, 12 May 2014 at 14:56:46 UTC, John Colvin wrote:
char[] is a rather special type of array: the language has
unicode support and iterates over it by code-point (i.e. not
guaranteed to be a single char per iteration).
If you want to sort chars and are assuming ASCII, you can just
use
On Friday, 6 June 2014 at 12:01:55 UTC, AntonSotov wrote:
const r1 = regex("bla");
matchFirst( "big string", r1 ); // ERROR!
immutable r2 = regex("bla"); // ERROR!
Why can I not use const/immutable regex?
I think it's a Phobos bug that can't use regex as immutable.
You can use const regex
On Friday, 6 June 2014 at 15:42:41 UTC, Meta wrote:
You should not do this, as it will create a new regex
everywhere you use it. Unlike const or immutable, enum in this
situation is more or less like a C macro.
#define r1 regex("bla")
I see. Thanks.
On Saturday, 7 June 2014 at 11:33:35 UTC, Meta wrote:
On Saturday, 7 June 2014 at 00:48:59 UTC, hane wrote:
On Friday, 6 June 2014 at 15:42:41 UTC, Meta wrote:
You should not do this, as it will create a new regex
everywhere you use it. Unlike const or immutable, enum in
this situation is more
On Monday, 23 June 2014 at 08:30:44 UTC, h_zet wrote:
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left value but
when I compiled this, no error occured. DM
On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote:
```
void bar()
{
throw new Exception("");
}
void foo() nothrow
{
scope(failure) {}
bar();
}
void main() {}
```
Doesn't compile with 2.066:
```
source/app.d(9): Error: 'app.bar' is not nothrow
source/app.d(6): Error
On Sunday, 6 July 2014 at 22:03:21 UTC, hane wrote:
On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote:
```
void bar()
{
throw new Exception("");
}
void foo() nothrow
{
scope(failure) {}
bar();
}
void main() {}
```
Doesn't compile with 2.066:
```
source/app.d(9): E
On Wednesday, 6 August 2014 at 04:14:51 UTC, Puming wrote:
1. The only way that I can initialize it is to assign a value.
But I want to initialize an empty AA, is that possible?
workaround:
string[string] aa;
assert(aa is null);
aa[""] = "";
aa.remove("");
assert(aa !is null);
On Wednesday, 6 August 2014 at 06:50:59 UTC, Alexandr Druzhinin
wrote:
This dlang.org/cpp_interface.html says I can do the following
// c++
namespace N {
void someCppFunction();
}
// d
extern (C++, N) void someCppFunction();
but this http://dpaste.dzfl.pl/e2242263e1dc says I can't
Is
On Wednesday, 20 August 2014 at 07:18:12 UTC, Kagamin wrote:
http://dlang.org/phobos/std_traits.html#TemplateOf
Or isInstanceOf.
static if (__traits(isSame, TemplateOf!R, SortedRange))
static if (isInstanceOf!(SortedRange, R))
On Wednesday, 20 August 2014 at 14:44:39 UTC, Etienne wrote:
I've been hearing that delegates get a context pointer which
will be allocated on the GC. Is this also true for delegates
which stay in scope?
e.g.
void addThree() {
int val;
void addOne() {
val++;
On Saturday, 23 August 2014 at 10:19:59 UTC, nikki wrote:
I am learning SDL by following the lazyfoo SDL2 tuorials, I am
alos new to D so I have a question:
I the lazyfoo tutorials there are many functions that have a
bool success whiich gets set at various places when something
goes wrong to
On Tuesday, 26 August 2014 at 04:34:39 UTC, ketmar via
Digitalmars-d-learn wrote:
On Mon, 25 Aug 2014 21:07:06 +
ponce via Digitalmars-d-learn
wrote:
Is there a way to have cross-module inlining but with separate
compilation?
Like with link-time generation in C++ compilers.
i think that
On Thursday, 4 September 2014 at 15:10:22 UTC, Jorge A. S. wrote:
I'm having an error related to yours: when I call writeln
function in a closed stdout I will get a segfault message.
Example:
import std.stdio;
void main() {
stdout.close();
write("hello\n");
}
The code above will crash wi
On Friday, 5 September 2014 at 07:22:23 UTC, hane wrote:
On Thursday, 4 September 2014 at 15:10:22 UTC, Jorge A. S.
wrote:
I'm having an error related to yours: when I call writeln
function in a closed stdout I will get a segfault message.
Example:
import std.stdio;
void main() {
stdout.clo
On Sunday, 7 September 2014 at 10:42:37 UTC, MarisaLovesUsAll
wrote:
Hi!
I'm trying to make my program multithreaded, and I was stuck at
messaging between threads.
I need to pack types and variables into one message. Will I use
Tuples or something?
e.g.
class Sprite {};
send(tid, Sprite, "c
18 matches
Mail list logo